简体   繁体   English

自定义样式干扰了平台对话框

[英]Custom style is interfering with platform dialogs

I've created a custom theme for my app, and it looks great! 我为我的应用程序创建了一个自定义主题,它看起来很棒! However, I've noticed that some default platform dialogs, such as the context menu when long-pressing an EditText doesn't show correctly. 然而,我注意到一些默认的平台对话,如上下文菜单时长按一个EditText没有正确显示。

On the left, a context menu through my app. 在左侧,通过我的应用程序的上下文菜单。 On the right, a standard context menu through a platform app. 右侧是通过平台应用程序提供的标准上下文菜单。

我的应用主题系统默认主题

Here's my style.xml : 这是我的style.xml

<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="Theme.Styled" parent="Theme.Sherlock">
        <!-- ... various app styles ... -->
        <item name="android:alertDialogStyle">@style/DialogHolo</item>
        <item name="android:dialogTheme">@style/DialogHolo</item>
    </style>

    <style name="DialogHolo" parent="android:style/Theme.Dialog">
        <item name="android:fullDark">@drawable/bg_dialog_full</item>
        <item name="android:topDark">@drawable/bg_dialog_top</item>
        <item name="android:centerDark">@drawable/bg_dialog_middle</item>
        <item name="android:bottomDark">@drawable/bg_dialog_bottom</item>
        <item name="android:fullBright">@drawable/bg_dialog_full</item>
        <item name="android:centerBright">@drawable/bg_dialog_middle</item>
        <item name="android:bottomBright">@drawable/bg_dialog_bottom</item>
        <item name="android:bottomMedium">@drawable/bg_dialog_bottom</item>
        <item name="android:centerMedium">@drawable/bg_dialog_middle</item>
        <item name="android:textColor">#ffe6e7e8</item>
    </style>

</resources>

Is it possible to either have these dialogs use the default style or get the text to appear in the desired text color? 是否可以使这些对话框使用默认样式或使文本以所需的文本颜色显示?

我从来没有找到一个完美的解决方案,而是在显示自定义对话框时只是在style.xml单独定义了一个主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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