【发布时间】:2014-10-07 04:49:02
【问题描述】:
我有一个 UIAlertView,它在 iOS 7 中完美显示,但在 iOS 8 中,它不显示任何按钮或标签。警报仍然可见,但只是一个小白框。 OK 和 cancel 按钮也接受它们的事件,但没有文本可见。
我已使用此警报在单击按钮时显示
- (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的子视图。
【问题讨论】:
-
这是真正的代码吗?如果不是,请发布实际代码。
-
@siddhant 发布真实代码。此代码也适用于 iOS 8。因此,将您在项目中编写的确切代码复制到此处。
-
Jeev,这是真正的代码。我刚刚使用它来显示单击按钮。
-
我检查了 iOS 8 中的框架:它给出了 (0,0,0,0) 但在 iOS 7 中它给出了一个确定的值。我还检查了迭代到 uialertview 的子视图。在 iOS7 中,它进入循环,因为它找到警报的子视图。在 iOS8 中,它说没有 alertView 的子视图。
标签: ios objective-c ios8 uialertview