更改线的颜色到上下文操作栏 [英] Change the color of the line into the Contextual Action Bar

查看:240
本文介绍了更改线的颜色到上下文操作栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改显示到上下文动作条线的颜色;更清楚,我就会把图片:

I would like to change the color of the line that appears onto the contextual action bar; to be more clear I will put an image:

您看到淡蓝色的线正上方的空白区域?我怎么会改变它的颜色?谢谢

You see the Light blue line just above the white area? How could I change its color? Thanks

推荐答案

您应该先与您要使用的色彩营造出自己的9片图像。例如像这样的图片:

You should first create your own 9-patch image with the colours which you want to use. For example an image like this :

和之后,在应用程序的主题,你应该添加这(对于霍洛主题):

And after that in your application's theme you should add this (for Holo Theme) :

<style name="Theme.MyAppTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionModeBackground">@drawable/my_actionmode_background</item>
</style>

有关 ActionBarSherlock 程序兼容性你应该使用:

<!-- AppCompat -->
<style name="Theme.MyAppTheme" parent="@style/Theme.AppCompat.Light">
    <item name="actionModeBackground">@drawable/my_actionmode_background</item>
</style>

<!-- ActionBarSherlock -->
<style name="Theme.MyAppTheme" parent="@style/Theme.Sherlock.Light">
    <item name="actionModeBackground">@drawable/my_actionmode_background</item>
</style>

这篇关于更改线的颜色到上下文操作栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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