定制操作栏福尔摩斯 [英] customizing action bar sherlock

查看:127
本文介绍了定制操作栏福尔摩斯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了操作栏福尔摩斯与theme.sherlock。操作栏有导航选项卡。我已经使用样式自定义操作栏。该风格的XML如下所示

I have implemented Action bar Sherlock with theme.sherlock. The action bar has navigation tab. I have used styles for customizing the action bar. The style xml is shown below

 <resources>
 <style name="MyTheme" parent="Theme.Sherlock">
<item name= "actionBarStyle">@style/ActionStyle</item>
<item name="actionBarTabTextStyle">@style/MyTabTextStyle</item>
</style>
<style name= "ActionStyle" parent="Widget.Sherlock.ActionBar">
   <item name="android:background">@drawable/actionstyle</item>
   <item name="background">@drawable/actionstyle</item>
  </style>
<style name="MyTabTextStyle" parent="Widget.Sherlock.ActionBar.TabText" >
<item name="android:textColor">#0EBFE9</item>
<item name ="android:textStyle">bold</item>
<item name= "android:textSize">14dp</item>
</style>
 </resources>

提拉动作风格

  <?xml version="1.0" encoding="utf-8"?>
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Bottom Line -->
<item>
    <shape android:shape="rectangle">
        <solid android:color="@android:color/darker_gray"/>
    </shape>
</item>

<!-- Color of your action bar -->
<item android:bottom="2dip">
    <shape android:shape="rectangle">
        <solid android:color="@android:color/darker_gray" />
    </shape>
</item>
</layer-list>

我需要
 删除操作栏和导航选项卡之间的分隔
 显示导航选项卡下方的蓝色分

I need to remove the divider between action bar and navigation tab show blue divider below the navigation tab

推荐答案

所有你需要做的就是设置背景您的XML 属性。您可以设置色的透明以删除它。

All you have to do is setting the background property of your xml. You can set the "color" transparent to remove it.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Bottom Line -->
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@android:color/transparent" />
        </shape>
    </item>

    <!-- Color of your action bar -->
    <item android:bottom="2dip">
        <shape android:shape="rectangle">
            <solid android:color="@color/action_bar_color" />
        </shape>
    </item>
</layer-list>

然后将其应用于你的主题:

Afterwards apply it in your theme:

<style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">
    <item name="android:background">@drawable/action_bar_background</item>
    <item name="background">@drawable/action_bar_background</item>
</style>

这篇关于定制操作栏福尔摩斯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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