Search code examples
titaniumtitanium-mobiletitanium-alloy

how to style tab bar icon alloy tatanium?


How to style the icons in the tab bar in tabbed view project. because when i put a *.png icons , the icons appear as gray in inactive tabs , and blue in the active tab, how to display it as it is.

<Tab title="Tab 1" icon="setting.png">
     <Window title="Tab 1">
       <Label>I am Window 1</Label>
     </Window>
   </Tab>

and how to add fonts icons to the tab icons ?


Solution

  • @mahmoud gamal Well, there's no a good way to style the tab bar in Titanium, it's hard to change the system-default-style of tab bar. The problem you had mentioned that the inactive tab will be grey and the active tab will be blue, well this the system style of the tab bar, you can check here for more details.

    However, you can set property activeIcon of tab bar to change it's active state style, but it's only support for IOS. If you want to get the tab bar more various style, we recommend you just define a view like the tab bar to accomplish what you want. And, pay attention to this that the tab embed with window will display at different position in Android(show at the top of he window) and IOS(show at the bottom at the window).