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. 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. It is a bug in the framework but this workaround works for the time being:
https://stackoverflow.com/a/19746561/1508506
I have this problem with Theme.AppCompat.Light.DarkActionBar theme and I think it's a bug. I tried to change the background in my style with the following (you can get the drawables from http://jgilfelt.github.io/android-actionbarstylegenerator/):
<!-- 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. Check the documentation for API level: http://developer.android.com/reference/android/R.attr.html#actionModeCopyDrawable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With