2016-10-04 12 views
1

我們的應用程序中有一個有警報,我們過去使用UIAlertView。我們已從UIAlertView更新爲UIAlertController(可從iOS8獲得),因爲UIAlertView在iOS9中已棄用。最近,我們收到了一位客戶的問題,稱有時候提醒按鈕有時會顯示爲空白,但無論標題是否顯示,按鈕都能按預期運行。UIAlertController - 在警報中顯示空白標題

設備:iPad的迷你(第1代) OS版本:iOS9

那麼,有什麼能顯示空白有時警報按鈕的問題?

+0

顯示您的代碼,設置了行動的標題。 – Connor

+1

更改tintColor。您的應用程序必須具有白色tintColor,而不是這些UIAlertController捕獲。 –

+0

顯示提醒視圖控制器按鈕操作代碼 – user3182143

回答

0

我試圖樣品one.It完美的作品

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Show Actions" message:@"Action Title" preferredStyle:UIAlertControllerStyleAlert]; 

UIAlertAction *save = [UIAlertAction actionWithTitle:@"SAVE" style:UIAlertActionStyleDefault handler:nil]; 
[alertController addAction:save]; 

UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"CANCEL" style:UIAlertActionStyleDefault handler:nil]; 
[alertController addAction:cancel]; 

UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; 
[alertController addAction:ok]; 

[alertController addAction:ok]; 
[alertController addAction:save]; 
[alertController addAction:cancel]; 

[self presentViewController:alertController animated:YES completion:nil]; 

輸出結果是

enter image description here

+0

客戶報告說按鈕標題顯示了一些時間,但不是每次都顯示有時,它們是空白的 –

+0

您是否嘗試過我的答案? – user3182143

+0

我已經使用類似的代碼,但文本不同;)順便說一句,這個問題不會每次都被重現。稍微難以確認的修復也:( –