UIAlertController和UIImagePickerController的使用
来源:互联网 发布:锐捷网络待遇怎么样 编辑:程序博客网 时间:2024/06/04 19:19
UIAlertController 解释:下拉菜单
UIImagePickerController 解释:照片选取器
1.UIAlertController
//1.声明UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];//2.增加一行按钮[alert addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {//点击按钮相应 NSLog(@"拍照" );//3.显示[self presentViewController:alert animated:YES completion:nil];
2.UIImagePickerController
//1.包含代理< UIImagePickerControllerDelegate>//2.声明(可显示)UIImagePickerController *imagePick = [[UIImagePickerController alloc]init]; [self presentViewController:imagePick animated:YES completion:nil]; //3.设置 imagePick.allowsEditing = YES; //图片可点击 imagePick.delegate = self; // 委托代理//4.代理函数(选中相片后执行的操作)- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{//将UIImageView上的视图设为自己选择的图片 [self.mainImageView setImage:image];//隐藏此视图 [self dismissViewControllerAnimated:YES completion:nil];}
0 0
- UIAlertController和UIImagePickerController的使用
- UIAlertController 和 UIAlertView的使用
- UIAlertView和UIAlertController的使用
- UIAlertController 的创建和使用
- UIAlertController和UIAlertAction的简单使用
- iOS在更改用户头像并保存至本地沙盒目录中对于UIImagePickerController、UIAlertController的使用
- UIImagePickerController的简化使用
- UIImagePickerController的简单使用
- UIImagePickerController的使用
- UIImagePickerController的详细使用
- UIImagePickerController的使用
- UIAlertController的使用(Swift)
- UIAlertController的使用示例
- UIAlertController的使用二
- UIAlertController的使用
- UIAlertController的使用
- 关于UIAlertController的使用
- UIAlertController的使用
- duplicate symbols for architecture x86_64
- 黑马程序员——Objective--C笔记Category、block
- MIPS 汇编指令学习
- eclipse基础环境配置和svn、maven的配置以及maven的安装
- oracle基本信息
- UIAlertController和UIImagePickerController的使用
- scala函数
- Android 事件分发机制测试以及总结
- Halo,Halo 2游戏的人工智能设计讲座
- 谷歌浏览器测试
- Android自定义对话框去掉白色边框
- 字体选中效果(改变颜色)
- 由异常掉电问题---谈xfs文件系统
- 解决android开发在大屏手机图片出现内存溢出