zoukankan      html  css  js  c++  java
  • UIActionSheet UIAlertView

     

    #import "LZJContactVC-2.h"

     

    @interface LZJContactVC_2 ()<UIActionSheetDelegate,UIAlertViewDelegate>

     

    @end

     

    @implementation LZJContactVC_2

     

    - (void)viewDidLoad {

        [super viewDidLoad];

        

    }

     

    //退出登录

    - (IBAction)loginOut:(id)sender {

    //    11111111

    //    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"确定要退出登录嘛?" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"确定退出" otherButtonTitles:nil];

    //    

    //    [actionSheet showInView:self.view];

        

    //    222222222

    //    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"确定要退出登录嘛?"  message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定",nil];

    //    

    //    [alert show];

    //    

    //

    //    33333333333

    //    //第一步:创建控制器

        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确定要退出嘛?" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

        //第二步:创建按钮

        UIAlertAction *action = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {

    //        NSLog(@"点击了取消");

        }];

        

        UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {

        

            [self.navigationController popViewControllerAnimated:YES];

        }];

        //第三步:添加按钮

        [alertVC addAction:action];

        [alertVC addAction:action1];

        //第四步:显示弹框.(相当于show操作)'

        [self presentViewController:alertVC animated:YES completion:nil];

      

        

        

    }

     

     

    //-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{

    //

    //    

    //    if (buttonIndex == 0) {

    //        //退出

    //        [self.navigationController popViewControllerAnimated:YES];

    //    }

    //    

    //}

    //

    //-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

    //    

    //    if (buttonIndex == 1) {

    //        //退出

    //        [self.navigationController popViewControllerAnimated:YES];

    //    }

    //    

    //

    //}

  • 相关阅读:
    OSX安装nginx和rtmp模块(rtmp直播服务器搭建)
    用runtime来重写Coder和deCode方法 归档解档的时候使用
    Homebrew安装卸载
    Cannot create a new pixel buffer adaptor with an asset writer input that has already started writing'
    OSX下面用ffmpeg抓取桌面以及摄像头推流进行直播
    让nginx支持HLS
    iOS 字典转json字符串
    iOS 七牛多张图片上传
    iOS9UICollectionView自定义布局modifying attributes returned by UICollectionViewFlowLayout without copying them
    Xcode6 iOS7模拟器和Xcode7 iOS8模拟器离线下载
  • 原文地址:https://www.cnblogs.com/liuzhenjie/p/5454619.html
Copyright © 2011-2022 走看看