Is there a functional difference between positive, negative, and neutral buttons, particularly in the context of AlertDialogs?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
To quote the documentation:
So it's entirely down to how you want to use it. It also influences order in a left-to-right sense (see Devunwired's answer for the ordering).
On Lolipop and above or whenever you use
Theme.AppCompat.Light
style, the buttons are arranged from left to right: Neutral, Negative and Positive.Note: the Neutral button is always placed at the extreme left while the Negative and Positive buttons are packed together towards the right. [Took me awhile battling with this.]
As stated earlier, it defines the order, and you can have only one button of each kind. However the order I get (left to right) is Neutral, Negative, Positive both on a phone running Marshmallow and Android Studio emulator configured to Jelly Bean. I use AppCompat libs, so the behavior I observe may be typical for newer Android versions. Anyway it is not Negative, Neutral, Positive (i.e. not as it was stated earlier).
According to Material Design Style Guide you shouldn't use neutral buttons anymore:
Dialog specs
Just the position they take within the dialog...