gpt4 book ai didi

ios - iPhone iOS8 : UIAlertView upside down rotation doesn't work fine when build from iOS7. 1 sdk 并在8.0及以上设备上运行

转载 作者:行者123 更新时间:2023-11-29 12:32:26 27 4
gpt4 key购买 nike

任何人都知道如何为 iOS 8 设备修复此问题。是 Apple 的 UIAlertview 实现问题吗?

我有相同的屏幕截图。但由于信誉限制无法上传:(

最佳答案

在 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];

}

尝试使用该解决方案。

关于ios - iPhone iOS8 : UIAlertView upside down rotation doesn't work fine when build from iOS7. 1 sdk 并在8.0及以上设备上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27270832/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com