开发者

Android alertdialog theme

iv tried several diffrent ways but cant seem to get the alertdialog to properly change themes. my activities have there custom theme set in the manifest so im not sure if this is causing the conflict.

im using :

AlertDialog alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(this,R.style.DialogStyle)).create();

and im using the follwing style:

  <style name="DialogStyle" parent="android:Theme" >    
    <开发者_运维百科item name="android:windowBackground">@drawable/background2</item>
    <item name="android:textColor">#014076</item>       
</style>

it only changes certain text colours. all the titles and messages are all still default white colours and the background doesnt change either.

any help please.


Prior to gingerbread, 2.3.X, you can't. It explicitly sets the theme in the constructor of the dialog, but in gingerbread you can supply it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜