首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏TechBox

    从相册中选择或拍照设置并上传头像图片设置头像

    alertControllerWithTitle:@"照片" message:@"拍照或者从相册中选择照片" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDestructive handler:^(UIAlertAction ; }else { NSLog(@"模拟其中无法打开照相机,请在真机中使用"); } }]; UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"相册" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction

    7.1K30发布于 2018-06-05
  • 来自专栏APP自动化测试

    iOS实现视频和图片的上传

    "上传照片" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction handler:^(UIAlertAction * _Nonnull action) { handler:^(UIAlertAction * _Nonnull action) { handler:^(UIAlertAction * _Nonnull action) { "上传视频" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction

    2.6K71发布于 2019-10-15
  • 来自专栏Helloted

    常用代码/Code

    alertControllerWithTitle:@"提示" message:@"确定要这样做么" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@ "确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }];

    66320编辑于 2022-06-07
  • 来自专栏mukekeheart的iOS之旅

    iOS学习——UIAlertController详解

    我们需要在UIAlertController提示器添加一个按钮时,先创建一个UIAlertAction,然后通过UIAlertController的 addAction: 方法将创建的UIAlertAction *cancelBtn = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull ]; //销毁按钮 UIAlertAction *destructiveAction = [UIAlertAction actionWithTitle:@"Destructive" style :UIAlertActionStyleDestructive handler:nil]; //取消按钮 UIAlertAction *cancelAction = [UIAlertAction

    4.6K170发布于 2018-03-01
  • 来自专栏TechBox

    UIAlertView、UIActionSheet、UIAlertController使用

    UIAlertAction * _Nonnull action) { }]; UIAlertAction *pickAction = [UIAlertAction actionWithTitle UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel UIAlertAction * _Nonnull action) { }]; UIAlertAction *commentAction = [UIAlertAction }]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel * _Nonnull action) { }]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle

    6.6K30发布于 2018-06-05
  • 来自专栏云原生布道专栏

    【IOS开发基础系列】UIAlertController专题

    通过创建UIAlertAction的实例,您可以将动作按钮添加到控制器上。UIAlertAction由标题字符串、样式以及当用户选中该动作时运行的代码块组成。 Objective-C版本: UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style: UIAlertActionStyleCancel handler: nil]; UIAlertAction *okAction = [UIAlertAction actionWithTitle: @"好的" style: UIAlertActionStyleDefault Objective-C版本: UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"好的" style: UIAlertActionStyleDefault 比如说在okAction这个按钮动作中:     Objective-C版本: UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"好的

    2.7K30编辑于 2023-10-16
  • 来自专栏ShaoYL

    遮罩 HUD 指示器 蒙板 弹窗

    *sure = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction (@"点击了【随便1】按钮"); }]]; [alertController addAction:[UIAlertAction actionWithTitle:@"随便2" style :UIAlertActionStyleDefault handler:^(UIAlertAction *action) { NSLog(@"点击了【随便2】按钮"); }]]; preferredStyle:UIAlertControllerStyleAlert]; // 添加按钮 UIAlertAction *sure = [UIAlertAction actionWithTitle preferredStyle:UIAlertControllerStyleAlert]; // 添加按钮 UIAlertAction *sure = [UIAlertAction actionWithTitle

    1.5K50发布于 2018-05-11
  • 来自专栏iOS开发随笔

    WKWebView不显示JS的Alert,Confirm,TextInput弹框解决方法

    : @"" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * action = [UIAlertAction actionWithTitle :@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { completionHandler : @"" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * cancelAction = [UIAlertAction completionHandler(NO); }]; UIAlertAction * confirmAction = [UIAlertAction actionWithTitle * action = [UIAlertAction actionWithTitle:@"完成" style:UIAlertActionStyleDefault handler:^(UIAlertAction

    7.8K30发布于 2018-07-04
  • 来自专栏日常技术分享

    ios 跳转第三方App实现导航

    title = maps[i][@"title"]; //苹果原生地图方法 if (i == 0) { UIAlertAction * action = [UIAlertAction actionWithTitle:title style:(UIAlertActionStyleDefault) handler:^(UIAlertAction [alert addAction:action]; continue; } UIAlertAction * action = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction

    2.8K30发布于 2018-09-13
  • 来自专栏LeeCen

    【iOS学习】——手势识别

    *sure = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; *cancle = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *savePhoto = [UIAlertAction actionWithTitle:@"保存到相册" style:UIAlertActionStyleDefault handler:^(UIAlertAction *openPhoto = [UIAlertAction actionWithTitle:@"打开相册" style:UIAlertActionStyleDefault handler:^(UIAlertAction *turnonCamer = [UIAlertAction actionWithTitle:@"打开相机" style:UIAlertActionStyleDefault handler:^(UIAlertAction

    2.4K10发布于 2018-10-11
  • 来自专栏一“技”之长

    iOS8统一的系统提示控件——UIAlertController

    另一个机制改变的地方是,其中按钮的触发方法不再通过代理处理,而是将按钮封装成了类:UIAlertAction。  actionWithTitle:@"仔细看" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {         actionWithTitle:(nullable NSString *)title style:(UIAlertActionStyle)style handler:(void (^ __nullable)(UIAlertAction 三、UIAlertController其他属性和方法 @property (nonatomic, readonly) NSArray<UIAlertAction *> *actions; 获取所有AlertAction @property (nonatomic, strong, nullable) UIAlertAction *preferredAction NS_AVAILABLE_IOS(9_0); iOS9后新增加的属性

    95410发布于 2018-08-16
  • 来自专栏ppppy_oschina

    iOS 调用系统相机和选择相册照片

    UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"相册" style:UIAlertActionStyleDefault handler:^(UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:@"相机" style:UIAlertActionStyleDefault handler:^(UIAlertAction [self presentViewController:camera animated:YES completion:nil]; }]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction

    1.4K20编辑于 2022-11-15
  • 来自专栏iOS Developer

    iOS开发之诱导用户为自己的App评论功能

    *refuseAction = [UIAlertAction actionWithTitle:@"? 残忍拒绝" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) { [userDefaults setObject *okAction = [UIAlertAction actionWithTitle:@"? *showAction = [UIAlertAction actionWithTitle:@"? 我要吐槽" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) { if (udUserChoose<=3 |

    1.2K40发布于 2018-07-04
  • 来自专栏iOS开发攻城狮的集散地

    WKWebView的使用

    actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { :@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }])]; [alertController addAction:([UIAlertAction actionWithTitle:@"打开" style:UIAlertActionStyleDefault handler actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    3.6K61发布于 2018-06-19
  • 来自专栏iOS开发~

    iOS_调起各个地图软件

    URLWithString:mapSchemeArr[i]]; if ([[UIApplication sharedApplication] canOpenURL:url]) { UIAlertAction *action = [UIAlertAction actionWithTitle:mapName[i] style:UIAlertActionStyleDefault handler:^(UIAlertAction mapName[i] toCoor:toCoor targetName:targetName]; }]; [alert addAction:action]; } } UIAlertAction *actionSystem = [UIAlertAction actionWithTitle:@"系统地图" style:UIAlertActionStyleDefault handler:^(UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];

    54410编辑于 2022-07-20
  • 来自专栏码客

    iOS 使用WKWebView

    (title: "取消", style: UIAlertAction.Style.cancel) { (action:UIAlertAction) in //取消 completionHandler (false) } alertView.addAction(cancelAction) let okAction = UIAlertAction.init(title: "确定", style : UIAlertAction.Style.default) { (action:UIAlertAction) in //确定 completionHandler(true) textField:UITextField) in //设置textField相关属性 textField.textColor = UIColor.red } let okAction = UIAlertAction.init (title: "确定", style: UIAlertAction.Style.destructive) { (action:UIAlertAction) in

    2K10发布于 2019-10-21
  • 来自专栏iOS开发攻城狮的集散地

    iOS 传感器集锦

    preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * openAction = [UIAlertAction actionWithTitle :@"打开" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [device * cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * openAction = [UIAlertAction * cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction

    1.8K60发布于 2018-05-22
  • 来自专栏iOS开发攻城狮的集散地

    iOS 传感器集锦

    preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * openAction = [UIAlertAction actionWithTitle :@"打开" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [device * cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * openAction = [UIAlertAction * cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction

    2K80发布于 2018-05-21
  • 来自专栏娱乐心理测试

    UIImagePickerController的中文界面和改变statusBar的颜色

    *cameraAction = [UIAlertAction actionWithTitle:@"照相机" style:UIAlertActionStyleDefault handler:^(UIAlertAction completion:nil]; }else{ NSLog(@"哎呀,没有摄像头"); } }]; //从手机相册选取 UIAlertAction *photoAction = [UIAlertAction actionWithTitle:@"相册" style:UIAlertActionStyleDefault handler:^(UIAlertAction completion:nil]; } else{ NSLog(@"图片库不可用"); } }]; //取消 UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];

    2.5K40发布于 2018-06-04
  • 来自专栏全栈程序员必看

    swift2.0 UIImagePickerController 拍照 相册 录像

    UIAlertController(title: "请选择", message:nil, preferredStyle: .ActionSheet) //取消按钮 let cancelAction: UIAlertAction (cancelAction) //拍照 let takePictureAction: UIAlertAction = UIAlertAction(title: "拍照", style: .Default = UIAlertAction(title: "相册", style: .Default) { action -> Void in [self .initWithImagePickView("相册") ] } actionSheetController.addAction(choosePictureAction) //摄像 let moviePictureAction: UIAlertAction = UIAlertAction(title: "摄像", style: .Default) { action -> Void in [self .initWithImagePickView("摄像")]

    62520编辑于 2022-07-05
领券