我的 alertview 出现两次,需要 2 次用户点击才能关闭。
- (void) showAlert: (NSString *) message
{
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"You chose"
message: message
delegate: self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"ok",nil];
av.tag = SLIDER_ALERT;
[av show];
}
然后我在委托方法“alertView: (UIAlertView *) alertView clickedButtonAtIndex: (int) index”中释放警报视图
我怀疑问题是我以编程方式构建了自己的视图层次结构。我有一个视图控制器的父视图。在此之下,我还有 2 个其他视图(parentView -> subview1 和 subview2)。我试图调用 [self.view addSubview: av] 但这不起作用。BringToFrontSubView 也没有:
任何帮助将非常感激
佩曼