如何以编程方式取消 UIAlertView
?
这是我用来显示 UIAlertView 的代码
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Save Background" message:@"Downloading..." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil, nil];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 70.0);
[myAlertView setTransform:myTransform];
[myAlertView show];
最佳答案
尝试像这样使用 dismissWithClickedButtonIndex:
:
这里是要使用的代码:
[myAlertView dismissWithClickedButtonIndex:-1 animated:YES];
关于iphone - 以编程方式取消 UIAlertView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11887709/