user interface - Android custom DialogFragment custom positive/negative button design -
i have custom dialogfragment (support library). set layout @color/ghostwhite, problem is, can't find way set positive/negative button in same color.
this how set buttons:
builder.setview(view) // add action buttons .setpositivebutton("shout!", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int id) { //publishstory(/*shouttext.gettext().tostring()"woww"); mlistener.ondialogpositiveclick(wagdialogfragment.this); } }) .setnegativebutton(r.string.cancel, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { } }); return builder.create();
you can call getbutton
dialoginterface.button_positive
, dialoginterface.button_negative
parameters changing color of both buttons as:
button okbutton = alertdialog.getbutton(dialoginterface.button_positive); // set ok button color here okbutton.setbackgroundcolor(r.color.ghostwhite); button nobutton = alertdialog.getbutton(dialoginterface.button_negative); // set no button color here nobutton.setbackgroundcolor(r.color.ghostwhite);
Comments
Post a Comment