How can I set the order of the positive and negative buttons in AlertDialog?

后端 未结 8 1733
挽巷
挽巷 2021-02-05 06:05

Why I want to do this is another discussion entirely, but I need to figure out the best way to make all my alert dialogs have the positive button on the right side. Note that i

8条回答
  •  野的像风
    2021-02-05 06:21

    • In AlertDialog buttonPanel,the three buttons sort by [Neutral] [Negative] [Positive]
    • then you can set buttons like following codes

      builder.setNeutralButton("Negative",listener);

      builder.setNegativeButton("Neutral",listener);

      builder.setPositiveButton("Positive",listener);

提交回复
热议问题