安卓ICS:在动作条删除蓝色的分? [英] Android ICS: Remove blue divider in ActionBar?

查看:136
本文介绍了安卓ICS:在动作条删除蓝色的分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序,这将是全屏,但会利用一些动作条的功能的。随着冰淇淋Sandwhich发布,我看到,我得到一个蓝色的分隔线/分离器的动作条的一部分。通常情况下,这将是很好的一致性,但对我来说,我需要删除分隔。

如何删除或风格的动作条在ICS分频器?

尝试设置自定义主题为机器人:款式/ Widget.Holo.ActionBar作为父母。 但是,设置如所述一个下面没有效果

 <项目名称=机器人:分>#FFFFFF< /项目>
 

解决方案

含有蓝色底线图形资产的操作栏的集装箱视图的背景,并设置为 @android:绘制/ ab_transparent_dark_holo 使用默认的Holo黑暗的主题的时候。

要删除这条线,你需要创建一个自定义样式你的动作条(根据 Widget.Holo.ActionBar 小工具.Holo.Light.ActionBar (或 .Solid 变种),并设置安卓背景的东西,不包括在底边框:

 <样式名称=MyTheme的父=机器人:Theme.Holo>
  <项目名称=机器人:actionBarStyle> @风格/ MyActionBar< /项目>
< /风格>

<样式名称=MyActionBar父=机器人:Widget.Holo.ActionBar>
  <项目名称=机器人:背景> @可绘制/ your_background_here< /项目>
< /风格>
 

注意:全息深/浅的动作条具有扎实的和透明的方式;这个蓝线默认显示为透明样式。全息暗动作条是透明的默认和全息光操作栏默认情况下坚实的。

I am working on an app which will be full-screen, but will utilize some of the functionalities of the ActionBar. With the Ice Cream Sandwhich release, I see that I get a blue line divider/separator as part of the ActionBar. Normally, it would be good for consistency, but in my case I need to remove the divider.

How can I remove or style the divider of the ActionBar in ICS?

Tried setting a custom theme with "android:style/Widget.Holo.ActionBar" as parent. However, settings such as the one below has no effect

<item name="android:divider">#FFFFFF</item>

解决方案

The graphic asset containing the blue bottom line is the background of the action bar's container view and is set to @android:drawable/ab_transparent_dark_holo when using the default Holo Dark theme.

To remove this line, you'll need to create a custom style for your action bar (based on Widget.Holo.ActionBar or Widget.Holo.Light.ActionBar (or the .Solid variants) and set the android:background to something that doesn't include the bottom border:

<style name="MyTheme" parent="android:Theme.Holo">
  <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<style name="MyActionBar" parent="android:Widget.Holo.ActionBar">
  <item name="android:background">@drawable/your_background_here</item>
</style>

Note: Holo Dark/Light action bars have solid and transparent styles; this blue line appears by default for the transparent style. Holo Dark action bars are transparent by default and Holo Light action bars are solid by default.

这篇关于安卓ICS:在动作条删除蓝色的分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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