Any way to change tab bar size?

I created a tab bar using widget.newTabBar but I am developing for the nook and in landscape mode so the buttons are small and squished into the center. Is there any way to change the button sizes? I know its possible to change the image size but I looked at the documentation and I didn’t see a place where I could change the actual button sizes. Any help is appreciated! :slight_smile: [import]uid: 14461 topic_id: 34381 reply_id: 334381[/import]

There’s a parameter in the tab bar buttons table for that:

http://docs.coronalabs.com/api/library/widget/newTabBar.html [import]uid: 147322 topic_id: 34381 reply_id: 136664[/import]

I’m sorry but I can’t seem to find what you’re talking about. :frowning: I see a width and height for the image for the buttons, but not the buttons themselves. [import]uid: 14461 topic_id: 34381 reply_id: 136702[/import]

???

I didn’t even notice. Hm. I’m not sure, then. That’s something I’d like to know too.

Sorry about that :slight_smile:

The only way I can see to change that is to do a “hack” into the tabBar and use the actual button itself. I tried and it is possible - if you want more info, here it is:
[text]
TabBar Hack Commencing Now

  1. The tabBar’s button group is under “tabBar.buttons”, it’s just a display group
  2. Each button is simply inserted into it, under “tabBar.buttons[]” where index is a number from 1 to the number of buttons.
    3. You can change the width and height of each button with simple .width and .height parameters
    4. But you’d have to change the x, too.
    [/text]

    That’s my best attempt at “hacking” into the tabBar :wink:

    Caleb [import]uid: 147322 topic_id: 34381 reply_id: 136715[/import]

Thanks a ton, that worked! I already have another problem though :frowning: When The button x changes it looks like it scales the whole group. Is there a way to scale just the button because now the text is all stretched. Or maybe there is another way to un-stretch the text?

EDIT: I actually just figured this out. I found out that the labels are easily accessible from the table. Just have to type:

tabs.buttons[1].label.width = 50 --or whatever other size

I also figured out that to change the x of each individual button I can say:

tabs.buttons[1].x = -50

Thanks for all your help!!! [import]uid: 14461 topic_id: 34381 reply_id: 136730[/import]

No problem :slight_smile:

Glad to help.

Caleb [import]uid: 147322 topic_id: 34381 reply_id: 136766[/import]

There’s a parameter in the tab bar buttons table for that:

http://docs.coronalabs.com/api/library/widget/newTabBar.html [import]uid: 147322 topic_id: 34381 reply_id: 136664[/import]

I’m sorry but I can’t seem to find what you’re talking about. :frowning: I see a width and height for the image for the buttons, but not the buttons themselves. [import]uid: 14461 topic_id: 34381 reply_id: 136702[/import]

???

I didn’t even notice. Hm. I’m not sure, then. That’s something I’d like to know too.

Sorry about that :slight_smile:

The only way I can see to change that is to do a “hack” into the tabBar and use the actual button itself. I tried and it is possible - if you want more info, here it is:
[text]
TabBar Hack Commencing Now

  1. The tabBar’s button group is under “tabBar.buttons”, it’s just a display group
  2. Each button is simply inserted into it, under “tabBar.buttons[]” where index is a number from 1 to the number of buttons.
    3. You can change the width and height of each button with simple .width and .height parameters
    4. But you’d have to change the x, too.
    [/text]

    That’s my best attempt at “hacking” into the tabBar :wink:

    Caleb [import]uid: 147322 topic_id: 34381 reply_id: 136715[/import]

Thanks a ton, that worked! I already have another problem though :frowning: When The button x changes it looks like it scales the whole group. Is there a way to scale just the button because now the text is all stretched. Or maybe there is another way to un-stretch the text?

EDIT: I actually just figured this out. I found out that the labels are easily accessible from the table. Just have to type:

tabs.buttons[1].label.width = 50 --or whatever other size

I also figured out that to change the x of each individual button I can say:

tabs.buttons[1].x = -50

Thanks for all your help!!! [import]uid: 14461 topic_id: 34381 reply_id: 136730[/import]

No problem :slight_smile:

Glad to help.

Caleb [import]uid: 147322 topic_id: 34381 reply_id: 136766[/import]