我有一个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中,它进入循环,因为它找到了alert的子视图。在iOS8中,它说alertView没有子视图。