对于蜂窝Android的动作条标签风格 [英] Android ActionBar tab style for Honeycomb

查看:133
本文介绍了对于蜂窝Android的动作条标签风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SDK中HoneycombGallery示例应用程序,并试图改变动作条选项卡的样式(即气球,自行车,机器人,糕点)。使用光的主题,该标签有一个蓝色的下划线。我只是想使这个红色匹配我工作的一个应用程序的风格。

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.

我已经试过研究SDK文档样式(<一href="http://developer.android.com/guide/topics/ui/actionbar.html">http://developer.android.com/guide/topics/ui/actionbar.html)和其他来源在网络上,但我不是很肯定,我明白什么属性/属性控制选项卡这个特殊的风格。

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.

如果任何人有可能会表现出动作条完整的自定义样式资源或code的例子,我想AP preciate吧。

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

推荐答案

您会希望熟悉应用自定义主题的活动。 <一href="http://developer.android.com/guide/topics/ui/themes.html">http://developer.android.com/guide/topics/ui/themes.html

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

主题属性安卓actionBarTabStyle 安卓actionBarTabBarStyle 安卓actionBarTabTextStyle 控制的操作栏中的选项卡的外观。默认样式使用安卓背景中的标签栏样式在未选择的项目细线和状态列表绘制的安卓背景的标签自己来处理侧重/选择/ pressed状态。背景资产本身是9补丁提供下划线在大多数情况下,但更COM prehensive亮点pressed /聚焦的状态。

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.

这篇关于对于蜂窝Android的动作条标签风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆