可能重複:
UIAlertView not showing message textUIAlertView中在橫向模式下不顯示消息
我試圖創建在橫向模式下的應用程序的簡單UIAlertView中,但我看到的是標題和按鈕,但沒有實際的消息。
它與屏幕上UIAlertView的可用空間有關,就好像我刪除了幾個按鈕,然後消息顯示正常。
有沒有辦法強制UIAlertView調整自己的大小以適應?
相關的代碼是在這裏
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Free Update",nil)
message:NSLocalizedString(@"There is a new version of this app available in the App Store. Download it now.",nil)
delegate:self
cancelButtonTitle:NSLocalizedString(@"Don't remind me",nil)
otherButtonTitles:NSLocalizedString(@"Download",nil), NSLocalizedString(@"Remind me later", nil), nil];
[alert show];
[alert release];
這是結果:
您如何使用操作表?它總是顯示標題,它意在用於採取行動。警報視圖有很多缺陷(不是實現,而是設計),我謹慎使用它們。 –
參見:http://stackoverflow.com/questions/7901834/uialertview-with-3-buttons-hides-message-in-landscape-mode – 2011-11-17 12:40:24