changing theme of android dialog

谁说我不能喝 提交于 2019-12-22 08:52:08

问题


In my Android application I have set the theme of the app as

android:Theme.Holo.Light

I created the dialog as

final Dialog dialog = new Dialog(DropPicupProcess.this);

But when I pop up an dialogbox in the app it shows as below.

How can I change the theme of the dialog into android:Theme.Holo.Light.


回答1:


Instead of this

final Dialog dialog = new Dialog(DropPicupProcess.this);

Create your dialog like this..

Dialog dialog=new Dialog(DropPicupProcess.this,android.R.style.Theme_Holo_Light);



回答2:


you can try this

Dialog dialog=new Dialog(DropPicupProcess.this,new ContextThemeWrapper(this,android.R.style.Theme_Holo_Light));


来源:https://stackoverflow.com/questions/20796049/changing-theme-of-android-dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!