[英]Holo Light with Dark Actionbar showing Holo Dark copy and paste icons
so I have an app that is Holo Light with Dark Actionbar and whenever I go to copy and paste something in an EditText, the icons are white so you can't see them. 所以我有一个应用程序是Holo Light with Dark Actionbar,每当我在EditText中复制和粘贴某些东西时,图标都是白色的,所以你看不到它们。 A screenshot is located below. 屏幕截图位于下方。 Is there any way to remedy this? 有什么方法可以解决这个问题吗? Thanks! 谢谢!
You have to manually set the theme again in the onCreateDialog method. 您必须在onCreateDialog方法中再次手动设置主题。 It is a bug in the framework but this workaround works for the time being: 这是框架中的一个错误,但此解决方法暂时适用:
https://stackoverflow.com/a/19746561/1508506 https://stackoverflow.com/a/19746561/1508506
I have this problem with Theme.AppCompat.Light.DarkActionBar theme and I think it's a bug. 我有Theme.AppCompat.Light.DarkActionBar主题的这个问题,我认为这是一个错误。 I tried to change the background in my style with the following (you can get the drawables from http://jgilfelt.github.io/android-actionbarstylegenerator/ ): 我尝试用以下方法改变我的风格背景(你可以从http://jgilfelt.github.io/android-actionbarstylegenerator/获得drawables):
<!-- styles.xml -->
<style name="Theme.MyThemeLightBase" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionModeBackground">@drawable/cab_background_top</item>
<item name="android:actionModeBackground">@drawable/cab_background_top</item>
</style>
And with this: 有了这个:
<!-- styles.xml -->
<style name="Theme.MyThemeLightBase" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionModeStyle">@style/my_action_mode_style</item>
<item name="android:actionModeStyle">@style/my_action_mode_style</item>
</style>
<style name="my_action_mode_style" parent="@style/Widget.AppCompat.Light.ActionMode.Inverse">
<item name="android:background">@drawable/cab_background_top</item>
</style>
But none of this solutions appears to work (please let me know if you finally get to change the background) so I decided to let the white background and just change the icons: 但这些解决方案似乎都不起作用(如果你最终改变背景,请告诉我)所以我决定让白色背景改变图标:
<!-- styles.xml -->
<style name="Theme.MyThemeLight" parent="Theme.MyThemeLightBase">
<item name="actionModeSelectAllDrawable">@drawable/ic_menu_selectall_holo_light</item>
<item name="android:actionModeSelectAllDrawable">@drawable/ic_menu_selectall_holo_light</item>
<item name="actionModeCutDrawable">@drawable/ic_menu_cut_holo_light</item>
<item name="android:actionModeCutDrawable">@drawable/ic_menu_cut_holo_light</item>
<item name="actionModeCopyDrawable">@drawable/ic_menu_copy_holo_light</item>
<item name="android:actionModeCopyDrawable">@drawable/ic_menu_copy_holo_light</item>
<item name="android:actionModePasteDrawable">@drawable/ic_menu_paste_holo_light</item>
<item name="actionModePasteDrawable">@drawable/ic_menu_paste_holo_light</item>
</style>
Note: You need to specify a styles.xml file in values, values-v11 and values-v14 because some attributes are not necesary added with or without the 'android' preffix. 注意:您需要在values,values-v11和values-v14中指定styles.xml文件,因为某些属性不是添加或不添加'android'预加。 Check the documentation for API level: http://developer.android.com/reference/android/R.attr.html#actionModeCopyDrawable 查看API级别的文档: http : //developer.android.com/reference/android/R.attr.html#actionModeCopyDrawable
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.