任何人都知道如何解决iOS 8设备的问题。这是Apple对UIAlertview的实施问题吗?
我有同样的屏幕截图。但由于声誉限制无法上传:(
答案 0 :(得分:1)
在IOS8中添加了UIAlertController而不是UIAlertView
if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) {
// use UIAlertView
}
else {
// use UIAlertController
[self showAlert];
}
-(void)showAlert
{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"AlertView" message:nil preferredStyle:UIAlertControllerStyleActionSheet;
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"GO" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
// [action doSomething];
}];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:defaultAction];
[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:nil];
}
尝试使用该解决方案。