我有一個UIAlertView在iOS 7中完美顯示,但在iOS 8中,它不顯示任何按鈕或標籤。警報仍然可見,但只是一個小白盒子。 「確定」和「取消」按鈕也將其事件作爲參考,但沒有文字可見。iOS 8:UIAlertView/UIAlertController不顯示文本或按鈕
我已經使用這個警報就按一下按鈕顯示
- (IBAction)sel_btnLogout:(id)sender {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Logout!" message:@"Are you sure you want to logout?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
[alert show];
}
我查了框架中的iOS 8:這是給(0,0,0,0),但在iOS的7這是給一個確定的價值。
我也檢查迭代到uialertview的子視圖。在iOS7中,它會進入循環,因爲它會發現警報的子視圖。在iOS8中,它表示沒有alertView的子視圖。
這是真正的密碼?如果不是,請發佈實際代碼。 – rmaddy 2014-10-07 04:52:40
@siddhant發佈真實的代碼。此代碼也在iOS 8中工作。因此,請在此複製您在項目中編寫的確切代碼。 – Jasmeet 2014-10-07 04:53:36
試試這個http://stackoverflow.com/questions/25927676/uialertview-title-not-display/25928050#25928050 – 2014-10-07 04:59:29