Reputation: 729
I'm using a FragmentActivity implementing ActionBar.TabListener.
I have themed my top/title bar to have a dark background, and a white font.
My three tabs, stacked below, have a light background and black font. This looks good in portrait, but for devices with more horizontal pixels, such as tablets, or landscape phones, the tab bar is absorbed into the main title bar. This behavior itself is fine, but the tab font is black and I need to change it to white for this specific scenario.
Is this supported?
I have figured out how to change the bottom highlight color and the tab background color, thanks to Is it possible to change actionbar tab indicator programmatically but I haven't been able to programatically change the font color yet.
I have tried creating a Spannable object, setting the color of that, then assigning that via myTab.setText(), but the theme seems to be overriding this color, although the text characters change is recognized.
Upvotes: 0
Views: 1158
Reputation: 729
Found a workable solution myself:
Using "values-land" and dpi-based descriptors I can use an alternate style for that specific instance (eg, landscape, or high DPI devices like tablets).
Create a 'values-land' folder and a styles.xml file inside of that automatically uses those styles for landscape views.
More info on how to do this: http://developer.android.com/guide/topics/resources/providing-resources.html
Upvotes: 1