简体   繁体   中英

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 app global text color and still remains black and very difficult to read with:

粘贴弹出窗口

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM