iOS 拨打电话三种方式总结
2024-08-25 03:50:17
1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
// NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
[self.view addSubview:callWebview];
[callWebview release];
[str release];
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
// NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
[self.view addSubview:callWebview];
[callWebview release];
[str release];
3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
// NSLog(@"str======%@",str);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]
感谢分享
最新文章
- zlib-1.2.7/libpng-1.5.9 instead of zlib-1.2.8/libpng-1.6.6
- Unshelve Instance 操作详解 - 每天5分钟玩转 OpenStack(39)
- 修改js confirm alert 提示框文字的简单实例
- gulp-rev:项目部署缓存解决方案----gulp系列(六)
- 浅析 - Storyboard / Xib
- LeetCode OJ 274. H-Index
- Firefly卡牌手游《暗黑世界V1.5》服务器端源码+GM管理后台源码
- Servlet课程0426(九)Servlet服务器端创建Cookie和客户端读取Cookie
- 未能加载文件或程序集“System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”
- 母版页中ContentPlaceHolder 控件的作用
- Fox And Jumping
- python3.4 安装 scrapy 报错 VS2010
- unity 球体表面平均分割点
- Vuex初级入门及简单案例
- vMware 按装 MacOs
- <;<;c专家编程>;>;笔记
- android使用inject需要注意的地方
- 05文件合并脚本--By Mark Lutz
- C++中重载(overload)、覆盖(override)与隐藏(oversee)
- Flex 排序 SortField and Sort