Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在主题活动中显示全息(暗)警报对话框?_Android_User Interface - Fatal编程技术网

Android 如何在主题活动中显示全息(暗)警报对话框?

Android 如何在主题活动中显示全息(暗)警报对话框?,android,user-interface,Android,User Interface,我已尝试使用内容包装器: ContextThemeWrapper wrapper = new ContextThemeWrapper(this, android.R.style.Theme_Holo_Dialog); AlertDialog.Builder builder = new AlertDialog.Builder(wrapper); 其结果,是一个黑白混合的对话框,非常可怕 在过去的两个小时里,我也尝试过使用定制样式等,但运气不好。我相信解决方案必须非常简单,我只需要欺骗AlertD

我已尝试使用内容包装器:

ContextThemeWrapper wrapper = new ContextThemeWrapper(this, android.R.style.Theme_Holo_Dialog);
AlertDialog.Builder builder = new AlertDialog.Builder(wrapper);
其结果,是一个黑白混合的对话框,非常可怕

在过去的两个小时里,我也尝试过使用定制样式等,但运气不好。我相信解决方案必须非常简单,我只需要欺骗AlertDialog Builder,使其认为我的活动是全息黑暗主题的。但是怎么做呢

这就是我的活动主题,也许我做错了什么:

<style name="ThemeSolarizedLight" parent="android:Theme.Holo.Light">
    <item name="android:background">@color/light_yellow</item>
    <item name="android:textColor">that No Wi-fi color you see up there</item>
</style>

@颜色/浅黄色
你在上面看不到Wi-fi的颜色

您使用的是actionbar的主题,而不是为dialog制作的主题

示例:

ContextThemeWrapper wrapper = new ContextThemeWrapper(this, android.R.style.Theme_Holo_Dialog;);

尝试此操作,结果完全相同。@user1032613在style.xml中为对话框创建一个主题并使用它