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:

  1. setpositivebutton(charsequence text, dialoginterface.onclicklistener listener)

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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -