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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With