我正在尝试使用警报按钮之一更改警报消息并且它发生了变化,但警报在触摸后消失了。 如何阻止警报 View 消失?只有按“确定”按钮它才会消失。
创建提醒:
- (void)showHint
{
NSLog(@"Show hint method");
NSString *hintName = [[jsonArray objectAtIndex:nearestBeaconPassedNumber] objectForKey:@"hint name"];
NSString *hintDescription = [[jsonArray objectAtIndex:nearestBeaconPassedNumber] objectForKey:@"description"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:hintName
message:hintDescription
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Simpler", @"More simpler", nil];
[alert show];
}
使用按钮更改消息:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
//Here I change alert's message
switch (buttonIndex) {
case 0:
NSLog(@"Ok");
[alertView setMessage: @"Ok"];
break;
case 1:
NSLog(@"Simpler");
[alertView setMessage: @"Simpler message"];
break;
case 2:
NSLog(@"More simpler message");
[alertView setMessage: @"More simpler message"];
break;
}
}
最佳答案
总而言之,确实不可能阻止 UIAlertView 在触摸其任何按钮后被关闭。
关于ios - 使用警报按钮更改警报消息而不关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33598382/