By default, we get two or three buttons that are horizontally aligned in an alert dialog. Is it possible to have them vertically aligned within the alert dialog?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure, you can use
Dialog.setContentView()to set the content of a dialog to be an arbitrary layout.Make yourself a layout file with a Vertical LinearLayout that has the buttons you want in it and call
setContentView()on your dialog, passing the name of your layout file.If you are deadset on
AlertDialogyou can do something similar withbuilder.setView()