Android ActionBar tab style for Honeycomb

邮差的信 提交于 2019-11-30 08:40:24

问题


I am using the HoneycombGallery sample app in the SDK and attempting to change the style of the ActionBar tabs (i.e., "Balloons", "Bikes", "Androids", "Pastries"). Using the "light" theme, the tabs have a blue underline. I simply want to make this red to match the style of an application I'm working on.

I've tried researching styles in the SDK documentation (http://developer.android.com/guide/topics/ui/actionbar.html) and other sources on the web, but I'm not quite certain that I understand what property/attribute controls this particular style of the tabs.

If anyone has a resource or code example that might demonstrate a complete custom styling of the ActionBar, I would appreciate it.


回答1:


You'll want to be familiar with applying a custom theme to an activity. http://developer.android.com/guide/topics/ui/themes.html

The theme attributes android:actionBarTabStyle, android:actionBarTabBarStyle, and android:actionBarTabTextStyle control the appearance of action bar tabs. The default styling uses android:background within the tab bar style for the thin line under unselected items, and a state list drawable as the android:background for the tabs themselves to handle focused/selected/pressed states. The background assets themselves are 9-patches that provide the underline in most cases but a more comprehensive highlight for pressed/focused states.



来源:https://stackoverflow.com/questions/5353465/android-actionbar-tab-style-for-honeycomb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!