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 不同?

4

2 回答 2

2

据我了解,这是苹果在 iOS 8.3 新版本中积极引入的一个变化

iOS 8

在此处输入图像描述

IOS 7

在此处输入图像描述

于 2015-05-06T12:52:31.050 回答
2

几周前我提交了一份关于此的雷达,Apple 回复说“这是警报中取消按钮的新设计。8.3 中开发人员的一致体验是所有警报左侧都有一个取消按钮(布局时)水平)和底部(垂直布局时)。Apple 自己的应用程序可能会选择以不同方式显示其按钮(例如,当鼓励用户选择特定选项时)。

这有点令人沮丧,因为系统提醒,例如删除应用程序时,符合旧行为,但我们自己的应用程序符合新设计,造成设计不一致。

于 2015-05-06T19:37:20.623 回答