Android change Default “Paste” popup text color of edittext

问题: I have an edittext field and when I want to paste someone on it, the text color of the "Paste" popup (Th System default "Paste" popup, NOT by custom) isn't the same as the...

问题:

I have an edittext field and when I want to paste someone on it, the text color of the "Paste" popup (Th System default "Paste" popup, NOT by custom) isn't the same as the app global text color and still remains black and very difficult to read with:

Paste Popup

Here is my overall theme styles:

style.xml

<!-- Base application theme. -->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>

<style name="AppTheme" parent="AppBaseTheme">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>

    <!---->
    <item name="android:textColor">@color/app_main_text_color</item>
    <item name="android:textSize">@dimen/general_text_textsize</item>
    <item name="android:background">@color/app_background_color</item>
    <item name="editTextStyle">@style/GeneralEditTextStyle</item>

</style>

<style name="AppActivityTheme" parent="AppTheme">
    <item name="android:background">@color/app_background_color</item>
</style>

<style name="GeneralEditTextStyle" parent="@android:style/Widget.EditText">
    <item name="android:background">@drawable/general_all_rect_border_transparent_background</item>
    <item name="android:textColor">@color/app_main_text_color</item>
</style>

color.xml

<color name="colorPrimary">#16365C</color>
<color name="colorPrimaryDark">#000000</color>
<color name="colorAccent">#FFFFFF</color>

<color name="app_background_color">#16365C</color>

<color name="app_main_text_color">#FFFFFF</color>

I tired to change the parent theme from Theme.AppCompat.Light.NoActionBar to Theme.AppCompat.NoActionBar and nothing in the "paste" dialog is changed at all.

So, how to change the text color of this "Paste" popup?


回答1:

Try this

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

And apply this theme to your popUp. It helped me for the overflow menu in the toolbar.

  • 发表于 2018-07-05 20:19
  • 阅读 ( 317 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除