UIAlertController 按钮位置不一致

11
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"hello" preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *ok     = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:hander]
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:hander]

[alertController addAction:ok];
[alertController addAction:cancel]; 

警报显示:
iOS 8.1 iPod touch:[确定][取消]
iOS 8.3 iPhone 6 Plus:[取消][确定]

为什么iPod和iPhone上按钮的位置不同?


你的问题是“为什么iPod和iPhone上的按钮位置不同”? - App Dev Guy
取消按钮通常放在 Mac 和 iOS 的左边。看起来像是一个错误。 - kelin
1
这是Apple在iOS 8.3中引入的行为变更。 - Mats
2个回答

2
据我所知,这是苹果在新版本iOS 8.3中积极引入的变化。
iOS 8 enter image description here iOS 7 enter image description here

2
我几周前提交了一份关于此事的报告,苹果回应说:“这是警报中取消按钮的新设计。在8.3中,对于所有警报,都应该在左侧(横向布局)和底部(纵向布局)拥有一个取消按钮以保持开发者的一致体验。苹果自己的应用程序可以选择以不同的方式显示按钮(例如在鼓励用户选择特定选项时)。”这有点令人沮丧,因为系统警报(如删除应用程序时)遵循旧行为,但我们自己的应用程序却遵循新设计,导致设计不一致。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接