Android AlertDialog Move PositiveButton to the right and NegativeButton on the left

后端 未结 7 1957
南方客
南方客 2021-01-07 23:11

I\'m new with android.

Currently I want to show an AlertDialog box with \'OK\' & \'Cancel\' buttons.

The default is PositiveButton: Left, Ne

7条回答
  •  温柔的废话
    2021-01-07 23:39

    This might not be a direct answer. But just some information on related topic. From this thread in Google's own forum, Romain guy said..

    Going forward the order of positive/negative buttons will be the one used in ICS.

    and the convention per OS version is

    • On devices prior to Honeycomb, the button order (left to right) was POSITIVE - NEUTRAL - NEGATIVE.
    • On newer devices using the Holo theme, the button order (left to right) is now NEGATIVE - NEUTRAL - POSITIVE.

    If it is a convention, that android/Google wants to follow, isn't it better you follow the same, since your users won't be using your app alone. After all user friendliness is the first thing a developer looks for..

提交回复
热议问题