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

    //1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示

      NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"000000000"];

        //            NSLog(@"str======%@",str);

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

    //2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种

     NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"00000000000"];

       UIWebView * callWebview = [[UIWebView alloc] init];

        [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];

    //    // 提示:不要将webView添加到self.view,如果添加会遮挡原有的视图

    //    // 懒加载

    //    if (_webView == nil) {

    //        _webView = [[UIWebView alloc] init];

    //    }

    //    NSLog(@"%p", _webView);

    //    

    //    NSURL *url = [NSURL URLWithString:@"tel://xxxxxxx"];

    //    NSURLRequest *request = [NSURLRequest requestWithURL:url];

    //    

    //    [_webView loadRequest:request];

    //3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示

     NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"000000000"];

        //            NSLog(@"str======%@",str);

     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

  • 相关阅读:
    多任务处理:控制默认行为
    多任务处理:管理调度Executor 接口
    多任务处理:服务器协议
    自己来做服务级的木马后门
    IBM ThinkPad
    韩国地名词汇/ 한국지명어휘(注册跑跑韩服有用)1
    EXE程序的自删除实现
    IBM ThinkPad
    EXE程序的自删除实现
    用VBScript实现对Windows注册表的修改
  • 原文地址:https://www.cnblogs.com/itlover2013/p/4315600.html
Copyright © 2011-2022 走看看