iOS开发用户打电话确认窗口的UI Alertview范例代码

iOS开发用户打电话确认窗口的UI Alertview可以通过以下范例代码实现

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”Title” message:@”Do you want to call…” delegate:self cancelButtonTitle:@”No” otherButtonTitles:@”Yes”, nil];
[alert show];

– (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: @”tel://%@”, phoneNum]]];
}
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注