UIAlertController inconsistent position of buttons
Asked Answered
D

2

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]; 

The alert shows:
iOS 8.1 iPod touch: [OK] [cancel]
iOS 8.3 iPhone 6 Plus: [cancel] [OK]

Why are the position of the buttons different from an iPod and an iPhone?

Discreet answered 4/5, 2015 at 8:9 Comment(3)
So your question is "Why are the position of the buttons different from an iPod and an iPhone"?Isbella
Cancel button is usually placed left on Mac and iOS. It looks like a bug.Laevo
This was a change in behaviour introduced by Apple in iOS 8.3.Esurient
G
2

I submitted a radar about this a couple weeks ago, and Apple responded saying "This is the new design for cancel buttons in alerts. The consistent experience for developers in 8.3 is for all alerts to have a Cancel button on the left (when laying out horizontally) and the bottom (when laying out vertically). Apple's own apps may choose to show their buttons differently (when encouraging the user to pick a particular option, for example)."

It's a little frustrating, as the system alerts, like when deleting an app, conform to the old behaviour, but our own apps conform to the new design, creating an inconsistent design.

Gainey answered 6/5, 2015 at 19:37 Comment(0)
K
2

As far as I know, this is a change that Apple actively introduced in the new version of iOS 8.3

iOS 8

enter image description here

iOS 7

enter image description here

Karykaryl answered 6/5, 2015 at 12:52 Comment(0)
G
2

I submitted a radar about this a couple weeks ago, and Apple responded saying "This is the new design for cancel buttons in alerts. The consistent experience for developers in 8.3 is for all alerts to have a Cancel button on the left (when laying out horizontally) and the bottom (when laying out vertically). Apple's own apps may choose to show their buttons differently (when encouraging the user to pick a particular option, for example)."

It's a little frustrating, as the system alerts, like when deleting an app, conform to the old behaviour, but our own apps conform to the new design, creating an inconsistent design.

Gainey answered 6/5, 2015 at 19:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.