模态对话框 UIAlertView
程序员文章站
2022-06-01 21:08:03
...
//显示双按钮对话框
- (void)showDialog2bt:(NSString*)msg bt1:(NSString*)bt1Title bt2:(NSString*)bt2Title{
UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@""
message:msg
delegate:self
cancelButtonTitle:bt1Title
otherButtonTitles:bt2Title,nil];
[alert show];
}
//响应事件
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
}else if (buttonIndex == 1) {
}
}