gpt4 book ai didi

ios - 打电话时如何自定义提醒 View

转载 作者:行者123 更新时间:2023-11-28 22:13:13 25 4
gpt4 key购买 nike

目前我正在使用UIWebView打电话

NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://123456789"];
[self.callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];

当我触摸一个按钮来调用电话时,UIAlertView 出现并要求确认标题为 123456789

如何更改其标题和消息?

谢谢。

最佳答案

不要使用UIWebView,只需向用户显示一个UIAlertView,询问他/她是否想打电话。 tel:方案中也没有//,所以tel:123456789是正确的。

然后只需通过 tel: 打开 [[UIApplication sharedApplication] openURL:telURL] url。

另外不要忘记检查用户设备是否可以调用电话:

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.
}

关于ios - 打电话时如何自定义提醒 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22373684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com