opening dial pad for calling number user want

前端 未结 2 1609
无人共我
无人共我 2021-01-14 17:42

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

[[UIApplica         


        
2条回答
  •  死守一世寂寞
    2021-01-14 18:28

    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;
    

    and

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",textfield.text]]];
    

    You have to see the format for entering the number.

提交回复
热议问题