[英]opening dial pad for calling number user want
i want to open dial pad when user click on call button and then user enter phone number and call it 我想在用户点击通话按钮时打开拨号盘,然后用户输入电话号码并拨打电话
i know we can make call like this 我知道我们可以这样打电话
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://2135554321"]];
but i want to open dial pad and then let user enter number and press call button to call 但我想打开拨号盘,然后让用户输入号码,然后按通话键拨打电话
if this is not possible then want to do something like my app open direct to dail pad then user call it and then it should redirect to my app 如果这是不可能的,那么想做我的应用程序打开直接到dail pad然后用户调用它,然后它应该重定向到我的应用程序
No you cant do this in iOS . 不,你不能在iOS中这样做。 iPhone SDK not gives you direct access to dial a numbers from the application .The one way to achieve this is take a text field
iPhone SDK不允许您直接访问从应用程序拨打号码。实现此目的的一种方法是采用文本字段
textfield.keyboardType = UIKeyboardTypePhonePad;
and 和
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",textfield.text]]];
You have to see the format for entering the number. 您必须查看输入号码的格式。
Why not create a UIView that has a " UITextField
" and when the text field comes up, have the keyboard set to only be numbers (ie pretty much the same thing as the dialpad). 为什么不创建一个具有“
UITextField
”的UIView,当文本字段出现时,将键盘设置为仅为数字(即与拨号盘几乎相同)。
And once they are done entering in the number, then you can call the " openURL
" line you have above. 一旦他们完成输入的号码, 然后你可以调用“
openURL
你有上述的”行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.