我希望用户不能单击UIAlertView上的cancel按钮,但我仍然希望它在那里,但它是灰色的。我知道有一个shouldEnableFirstButton函数,但它不涉及取消按钮。你知道怎么做吗?
谢谢。
发布于 2014-03-21 06:17:02
使用以下内容:
UIAlertView *vw = [[UIAlertView alloc] initWithTitle:@"Information" message:@"This is a message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel", nil];
[vw show];所以,基本上你是在设置"Cancel“as other按钮。
现在,以下方法将解决您的问题:
- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView
{
return NO;
}如果你想在点击OK按钮时执行一些操作,你可以在这里执行:
- (void)alertViewCancel:(UIAlertView *)alertViewhttps://stackoverflow.com/questions/22544902
复制相似问题