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]];
  • 相关阅读:
    NodeJS第4天笔记
    NodeJS第3天笔记
    NodeJS第3天笔记
    NodeJS第3天笔记
    NodeJS第2天笔记
    NodeJS第1天笔记
    6、开发工具webstorm添加多个项目
    5、MongoDB索引
    4、mongodb更改字段类型
    mongodb安装和使用备忘
  • 原文地址:https://www.cnblogs.com/-yun/p/7464751.html
Copyright © 2011-2022 走看看