更改 ActionMode 的颜色并删除 android 中的 DONE 按钮
change ActionMode's color and remove DONE button in android
我在我的 android 项目中使用 Acion 模式。
我想改变它的颜色,同时移除它的 DONE 按钮。
我用谷歌搜索并编写了这段代码。
但是,一旦我 运行 它,它就会显示 "has stopped" 错误。
我该如何解决?
这是我的代码:
<style name="AppTheme" parent="android:Theme.Holo">
<item name="android:actionModeBackground">@style/ActionMode</item>
<item name="android:actionModeCloseButtonStyle">@style/NoCloseButton</item>
</style>
<style name="ActionMode" parent="@android:style/Theme.Holo.Light">
<item name="android:actionModeBackground">@android:color/white</item>
</style>
<style name="NoCloseButton" parent="@android:style/Widget.ActionButton.CloseMode">
<item name="android:visibility">gone</item>
</style>
而且我已经在清单中设置了android:theme="@style/AppTheme"
。
请帮帮我
使用此代码,您可以更改操作模式的背景颜色,还可以更改完成图像。
注意:您也可以在图片中添加文字!
在 res/styles.xml:
<style name="AppTheme" parent="android:Theme.Holo">
<item name="android:actionModeBackground">@android:color/COLOR</item>
<item name="android:actionModeCloseDrawable">@drawable/IMAGE</item>
我在我的 android 项目中使用 Acion 模式。
我想改变它的颜色,同时移除它的 DONE 按钮。
我用谷歌搜索并编写了这段代码。
但是,一旦我 运行 它,它就会显示 "has stopped" 错误。
我该如何解决?
这是我的代码:
<style name="AppTheme" parent="android:Theme.Holo">
<item name="android:actionModeBackground">@style/ActionMode</item>
<item name="android:actionModeCloseButtonStyle">@style/NoCloseButton</item>
</style>
<style name="ActionMode" parent="@android:style/Theme.Holo.Light">
<item name="android:actionModeBackground">@android:color/white</item>
</style>
<style name="NoCloseButton" parent="@android:style/Widget.ActionButton.CloseMode">
<item name="android:visibility">gone</item>
</style>
而且我已经在清单中设置了android:theme="@style/AppTheme"
。
请帮帮我
使用此代码,您可以更改操作模式的背景颜色,还可以更改完成图像。 注意:您也可以在图片中添加文字! 在 res/styles.xml:
<style name="AppTheme" parent="android:Theme.Holo">
<item name="android:actionModeBackground">@android:color/COLOR</item>
<item name="android:actionModeCloseDrawable">@drawable/IMAGE</item>