打开用户想要的电话号码的拨号盘 [英] 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
如果这不可能,那么想做些类似我的应用程序的操作,直接将其打开到dail pad,然后用户调用它,然后它应该重定向到我的应用程序
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
推荐答案
不,您不能在iOS中执行此操作. iPhone SDK不允许您直接从应用程序拨打号码.实现此目的的一种方法是 接受一个文本字段
No you cant do this in 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
textfield.keyboardType = UIKeyboardTypePhonePad;
和
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",textfield.text]]];
您必须查看输入数字的格式.
You have to see the format for entering the number.
这篇关于打开用户想要的电话号码的拨号盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!