Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAlertController inconsistent position of buttons

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?

like image 367
Ted Avatar asked May 04 '15 08:05

Ted


1 Answers

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.

like image 198
Colin Humber Avatar answered Oct 16 '22 21:10

Colin Humber