Is it possible to cutomize only the bottom of the alert dialog? I would like to set a different background color for the part where the Yes/No buttons are displayed without changing the rest of the window.
Asked
Active
Viewed 187 times
1
-
3You can create a custom layout for the alert dialog. Check [How to create a custom alert dialog](https://stackoverflow.com/questions/13341560/how-to-create-a-custom-dialog-box-in-android) – SripadRaj Jul 28 '17 at 08:40
-
@SripadRaj thanx, the given link seems to contain the answer to my question – Moussa Jul 28 '17 at 08:55
1 Answers
0
if you want to change the complete layout of button then try to create custom layout for alert dialog
or if you just want to change the color of the buttons then try below code
AlertDialog.Builder aDB = new AlertDialog.Builder(NewApplication.this);
aDB.setCancelable(false).setNegativeButton("Yes",new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
//Do something
}
});
AlertDialog alertDialog = aDB.create();
alertDialog.show();
alertDialog.getButton(Dialog.BUTTON_NEGATIVE).
setBackgroundColor(Color.parseColor("#ffffff"));
Note : Write the upper code after the dialog.show();

Hannan Max
- 49
- 6