I want to use the default Alert dialog with a message an 2 buttons. However, I want to style it differently. So the buttons text color and size, the title text color, size and background. Do I need to create a custom dialog or is there a way I can change the default one without having to create a custom dialog? Thank you
Asked
Active
Viewed 58 times
1 Answers
2
The easiest way to do this is to create a new layout xml file, for example dialog_layout.xml
. Design your dialog just like you design any activity. Then, before you create the dialog with the builder, and after builder.create(getActivity())
, callbuilder.setView(R.layout.dialog_layout)
and it should look exactly the way you want it.
Here is a similar question that you can read through
EDIT: small correction

N. Matic
- 213
- 1
- 8
-
I was asking if there is a way to do it "Without" it being custom dialog, ie my own layout – Snake Dec 03 '18 at 03:27