【问题标题】:UIAlertController inconsistent position of buttonsUIAlertController 按钮位置不一致
【发布时间】:2015-05-04 08:09:59
【问题描述】:
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: [OK] [取消]
iOS 8.3 iPhone 6 Plus: [取消] [OK]

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

【问题讨论】:

  • 所以你的问题是“为什么按钮的位置与 iPod 和 iPhone 不同”?
  • 取消按钮通常放在 Mac 和 iOS 的左侧。它看起来像一个错误。
  • 这是 Apple 在 iOS 8.3 中引入的行为更改。

标签: ios objective-c uialertcontroller uialertaction


【解决方案1】:

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

这有点令人沮丧,因为系统会发出警报,例如在删除应用时,符合旧的行为,但我们自己的应用符合新的设计,造成了不一致的设计。

【讨论】:

    【解决方案2】:

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

    iOS 8

    iOS 7

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多