2014-06-29 31 views
0

我曾尝试使用内容包装:如何在主题活动中显示全息(黑色)AlertDialog?

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

这样做的结果,是黑暗和白色的,可怕的混合的对话框。

我也试过在过去2小时内使用自定义样式等,没有运气。我相信解决方案必须非常简单,我只需要欺骗AlertDialog生成器就可以认为我的活动是Holo黑暗主题。但是如何?

enter image description here

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

<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> 

回答

0

您使用的是动作条的主题,而不是使用对话框

样本所作的主题:

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

试过这个,结果完全一样。 – user1032613

+0

@ user1032613在您的对话框的style.xml文件中创建主题并使用它 –

相关问题