0

嗨,这是我的样式属性,“myAppTheme”是我的应用程序的主题,“MyActionModeStyle”是我的动作模式的样式。

      <style name="myAppTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">@color/primaryColor</item>
        <item name="colorPrimaryDark">@color/primary_dark</item>
        <item name="android:windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="android:windowActionModeOverlay">true</item>
        <item name="actionModeStyle">@style/MyActionModeStyle</item>
    </style>

    <style name="MyActionModeStyle" parent="Widget.AppCompat.ActionMode">
        <item name="actionModeBackground">@drawable/red_bg</item>
        <item name="android:actionModeBackground">@drawable/red_bg</item>
        <item name="backgroundSplit">@drawable/red_bg</item>
        <item name="android:backgroundSplit">@drawable/red_bg</item>
        <item name="android:titleTextStyle">@style/ActionModeText</item>
        <item name="titleTextStyle">@style/ActionModeText</item>
    </style>

I want to change the background of action ode to red color but unfortunately nothing happends, still action mode is in default white color.. How can i change its color.. Any idea ?
4

1 回答 1

0

哦 !最后我得到了一个解决方案。我已经将我的动作模式自定义主题更改为活动主题。现在它的作品..这是我的活动自定义主题

android:theme="@style/customActionModeTheme" 

这是我的自定义风格

<style name="customActionModeTheme" parent="myAppTheme"> 
    <item name="android:actionModeBackground">@color/primaryColor</item> 
    <item name="actionModeBackground">@color/primaryColor</item> 
</style>
于 2015-07-13T13:42:56.957 回答