Android 动作模式视图背景颜色无法更改
Android action mode view background color is not able to change
嗨,这是我的样式属性,"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 ?
哦!最后我得到了一个 solution.I 将我的动作模式自定义主题更改为活动的 theme.Now 它的作品.. 这是我为 activity
自定义的主题
android:theme="@style/customActionModeTheme"
这是我的自定义样式
<style name="customActionModeTheme" parent="myAppTheme">
<item name="android:actionModeBackground">@color/primaryColor</item>
<item name="actionModeBackground">@color/primaryColor</item>
</style>
嗨,这是我的样式属性,"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 ?
哦!最后我得到了一个 solution.I 将我的动作模式自定义主题更改为活动的 theme.Now 它的作品.. 这是我为 activity
自定义的主题android:theme="@style/customActionModeTheme"
这是我的自定义样式
<style name="customActionModeTheme" parent="myAppTheme">
<item name="android:actionModeBackground">@color/primaryColor</item>
<item name="actionModeBackground">@color/primaryColor</item>
</style>