zoukankan      html  css  js  c++  java
  • iOS 拨打电话三种方式

     1 1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
     2  NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
     3     //            NSLog(@"str======%@",str);
     4 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
     5     
     6 
     7 2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
     8 NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
     9     UIWebView * callWebview = [[UIWebView alloc] init];
    10     [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    11     [self.view addSubview:callWebview];
    12     [callWebview release];
    13     [str release];
    14 
    15 
    16 
    17 
    18 3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示
    19  NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
    20     //            NSLog(@"str======%@",str);
    21     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
  • 相关阅读:
    fzu 2122
    hdu 4707 bellman
    sicily 10330. Cutting Sausages
    湖南省2016省赛题。1809: Parenthesis 线段树
    Panoramic Photography
    B. No Time for Dragons 贪心
    The Weakest Sith
    E. The Best among Equals
    Gym 101149I I
    AtCoder D
  • 原文地址:https://www.cnblogs.com/-yun/p/7464751.html
Copyright © 2011-2022 走看看