2015-05-04 43 views
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: [OK] [取消]
的iOS 8.3 iPhone 6加: [取消] [OK]UIAlertController不一致位置

爲什麼按鈕的位置與iPod和iPhone不同?

+0

所以你的問題是「爲什麼按鈕的位置不同於iPod和iPhone?」 –

+0

取消按鈕通常放置在Mac的左側和iOS,它看起來像一個bug – kelin

+0

是的,這很奇怪 –

回答

1

幾周前我提交了一個關於這個的報道,蘋果回答說:「這是取消bu的新設計ttons警報。對8.3中的開發人員來說,一致的體驗是所有警報在左側(水平佈局時)和底部(垂直佈局時)都有一個「取消」按鈕。蘋果自己的應用程序可能會選擇以不同的方式顯示其按鈕(例如,鼓勵用戶選擇特定選項時)。「

這有點令人沮喪,因爲系統會發出警報,例如刪除應用程序時,行爲,但我們自己的應用程序符合新設計,創造了不一致的設計。

2

據我所知,這是一個變化,蘋果在iOS 8.3版本

新版積極引進的iOS 8

enter image description here

的iOS 7

enter image description here