我怎样才能改变操作栏API 15风格风格、操作、API

2023-09-12 01:49:16 作者:此情、ー世不變

我想改变我的行动吧的风格,所以我想改变下的操作栏由蓝色变为橙色线条的颜色,我该怎么办呢?

I want to change the style of my Action bar so I want to change the color of line under the action bar from Blue to Orange , how can I do that?

推荐答案

这是一个很好的教程的这里

There is a good tutorial here

您的自定义绘制创建一个新的样式

Create a new style with your custom drawable

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- the theme applied to the application or activity -->
    <style name="Theme.MyStyle" parent="@android:style/Theme.Holo">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <!-- other activity and action bar styles here -->
    </style>

    <!-- style for the action bar backgrounds -->
    <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">@drawable/ab_background</item>
        <item name="android:backgroundStacked">@drawable/ab_background</item>
        <item name="android:backgroundSplit">@drawable/ab_split_background</item>
    </style>
</resources>

然后在 AndroidManifest.xml中添加自定义样式

<application
        android:debuggable="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"

        android:theme="@style/Theme.MyStyle"
        >
   <activity ...>
   <activity .../>
   ...

</application>
 
精彩推荐
图片推荐