Android: How to set Text size of Button on a Dialog programatically? -
i writing android app need put bigger text on buttons of dialog windows programatically.
i saw there 2 options set (positive, negative or neutral) buttons on alertdialog.builder
:
setpositivebutton(charsequence text, dialoginterface.onclicklistener listener)
setpositivebutton(int textid, dialoginterface.onclicklistener listener)
,
in option 1, can set text , in option 2, can use resource id of text value. none of options allow me add styled button.
is there other way?
there no need create custom view.
the dialog builder create method returns alertdialog object gives access buttons.
alertdialog.builder alert = new alertdialog.builder(your_context); alertdialog dialog = alert.create(); // positive dialog.getbutton(dialoginterface.button_positive).settextsize(the_size); // negative dialog.getbutton(dialoginterface.button_negative).settextsize(the_size);
Comments
Post a Comment