Change the color of the line into the Contextual Action Bar

↘锁芯ラ 提交于 2020-01-15 05:26:11

问题


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


回答1:


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>

For ActionBarSherlock or AppCompat you should use :

<!-- 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>


来源:https://stackoverflow.com/questions/20239978/change-the-color-of-the-line-into-the-contextual-action-bar

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