1,这种方式,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@"tel:%@",@"186xxxxxxxx"]; // nslog(@"str======%@",str); [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:str]];
2,这种方式,打完电话后还会回到原来的程序,也会弹出提示,一般用这种
nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@"tel:%@",@"186xxxxxxxx"]; uiwebview * callwebview = [[uiwebview alloc] init]; [callwebview loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:str]]]; [self.view addsubview:callwebview];
3,这种方式,也会回去到原来的程序里(注意这里的telprompt),也会弹出提示
nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@"telprompt://%@",@"186xxxxxxxx"]; // nslog(@"str======%@",str); [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:str]]
以上所述是小编给大家介绍的ios 拨打电话代码的三种方式,希望对大家有所帮助
如对本文有疑问, 点击进行留言回复!!
M - Jamie‘s Contact Groups POJ - 2289(二分 + 多重匹配)
H - Antenna Placement POJ - 3020(最小边覆盖)
Unity组件【Camera && Flare Layer】
K - Treasure Exploration POJ - 2594
网友评论