iOS调用打电话功能
2016-04-25 18:45
302 查看
UIAlertController
*alert = [UIAlertController
alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alert
addAction:[UIAlertAction
actionWithTitle:@"025-58185888"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction
* _Nonnull action) {
//、调用
打电话phone
//iOS应用内拨打电话结束后返回应用
[[UIApplication
sharedApplication]
openURL:[NSURL
URLWithString:@"tel://025-58185888"]];
}]];
[alert
addAction:[UIAlertAction
actionWithTitle:@"取消"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction
* _Nonnull action) {
}]];
[self
presentViewController:alert
animated:YES
completion:nil];
//文字颜色
[alertAct1 setValue:[UIColor blackColor] forKey:@"_titleTextColor"];
*alert = [UIAlertController
alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alert
addAction:[UIAlertAction
actionWithTitle:@"025-58185888"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction
* _Nonnull action) {
//、调用
打电话phone
//iOS应用内拨打电话结束后返回应用
[[UIApplication
sharedApplication]
openURL:[NSURL
URLWithString:@"tel://025-58185888"]];
}]];
[alert
addAction:[UIAlertAction
actionWithTitle:@"取消"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction
* _Nonnull action) {
}]];
[self
presentViewController:alert
animated:YES
completion:nil];
//文字颜色
[alertAct1 setValue:[UIColor blackColor] forKey:@"_titleTextColor"];
相关文章推荐
- ios基础知识整理1
- iOS开发:提取MP3文件中的信息
- BOMStream BOMStreamWithFileAndSys
- [iOS适配-- launchImage]
- iOS公钥 私钥原理以及相关资源
- iOS 2D 绘图(Quartz2D)
- ios block
- 消息推送测试 远程通知
- block语法
- IOS 关键字
- iOS深入学习(Block全面分析)
- 自动布局之masonry
- iOS组件封装与自动布局自定义表情键盘
- Git新电脑从头开始搭建及使用
- iOS开发——点击图片全屏显示
- iOS自定义键盘切换效果
- iOS-开发之 pch 文件的使用
- iOS 打包ipa测试包
- iOS开发——缩放图片
- audio 在ios上自动播放问题