java - How to change front size and Set it mid AlertDialog.Builder by ArrayList -
this code want change front size , let in mid, example seldom explain . help.
painlist = new arraylist<>(); painlist.add(getstring(r.string.painl1)); painlist.add(getstring(r.string.painl2)); new alertdialog.builder(clear.this) .settitle("aaa") .setitems( painlist.toarray(new string[painlist.size()]), new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { if (which == 0) { intent go = new intent(); go.setclass(clear.this, pain.class); startactivity(go); } if (which == 1) { intent go = new intent(); go.setclass(clear.this, clear.class); startactivity(go); } } }).show();
thanks!!
you must use style dialog. example create my_dialog_style.xml in values res folder:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="mydialogstyle" parent="@android:style/theme.dialog"> <item name="android:textcolor">#ff000000</item> <item name="android:textsize">16sp</item> </style> </resources>
and apply dialog:
alertdialog.builder builder = new alertdialog.builder(new contextthemewrapper(this, r.style.mydialogstyle));
one way set gravity of text use this:
textview messagetext = (textview) alertdialog.findviewbyid(android.r.id.message); messagetext.setgravity(gravity.center);
Comments
Post a Comment