[英]How do I custom the alert view when making a phone call
currently I'm using UIWebView
to make phone calls 目前我正在使用
UIWebView
拨打电话
NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://123456789"];
[self.callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];
when I touch on a button to make call, an UIAlertView
appears and ask for confirmation with title 123456789
当我触摸按钮拨打电话时,会出现
UIAlertView
并要求确认标题为123456789
How can I change its title and message ? 如何更改标题和消息?
Thanks. 谢谢。
Don't use a UIWebView
, just present a UIAlertView
to the user asking if he/she want to call. 不要使用
UIWebView
,只是向用户询问他/她是否想要打电话的UIAlertView
。 Also there are no //
in the tel:
scheme, so tel:123456789
is correct. 在
tel:
scheme中也没有//
,所以tel:123456789
是正确的。
Then just open open the tel:
url via [[UIApplication sharedApplication] openURL:telURL]
. 然后通过
[[UIApplication sharedApplication] openURL:telURL]
打开tel:
url。
Also do not forget the check whether the users device can make phone calls: 另外不要忘记检查用户设备是否可以拨打电话:
NSURL *telURL = [NSURL URLWithString:@"tel:123456789"];
if ([[UIApplication sharedApplication] canOpenURL:telURL]) {
// Present the user with the dialog to start the call
} else {
// inform the user that he/she can't call numbers from their device.
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.