zoukankan      html  css  js  c++  java
  • 进击的UI--------------UIActionSheet(提示)

    // UIActionSheet这个控件很常用,和UIAlertView类似,先附图
    // 添加了过多的选项,就会以列表的形式显示
    IOS--UIActionSheet详细使用
     
    // 正常显示
    IOS--UIActionSheet详细使用
     
    // 下面直接上代码
    // 注意,需要在头文件中实现UIActionSheetDelegate协议
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"请选择你喜欢的水果"                                                      delegate:self                                                      cancelButtonTitle:@"取消"
    destructiveButtonTitle:@"确定" // 这个按钮的会以红色显示,在次设置一些重要的选项                                                    otherButtonTitles:@"苹果", @"葡萄", @"大枣儿", @"哈密瓜", @"杏儿", @"荔枝", nil];
    actionSheet.delegate = self; // 设置代理为本身actionSheet.actionSheetStyle = UIActionSheetStyleAutomatic; // 设置样式  
    [actionSheet showInView:self.view]; // 设置UIAcitonSheet在哪个view上显示
    [actionSheet release], actionSheet = nil;
    // 代理方法
    #pragma mark - 重写-----UIActionSheetDelegate协议中的方法
    #pragma mark 判断您点击的是哪个按钮
    - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
        NSLog(@"点击了序号为 %d 的按钮", buttonIndex);
    }
    #pragma mark 将要隐藏
    - (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex {
    NSLog(@"点击序号为 %d 的按钮  <<span style="line-height: normal; font-family: 'Heiti SC Light'; ">将要>  使UIActionSheet隐藏", buttonIndex);
    }
    #pragma mark 已经隐藏
    - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    NSLog(@"点击序号为 %d 的按钮  <<span style="line-height: normal; font-family: 'Heiti SC Light'; ">已经>  使UIActionSheet隐藏", buttonIndex);}
    #pragma mark 不明白这个方法,希望懂的告诉下
    - (void)actionSheetCancel:(UIActionSheet *)actionSheet {
    }
     
  • 相关阅读:
    Flink:What is stream processing?
    Flink1.10.1集成Hadoop3.0.0源码编译实战
    2003-Can't connect to Mysql on '主机名'(10061)
    Mybatis:Tag name expected
    谷歌浏览器安装json格式化插件
    kafka最佳实践:Kafka Best Practices
    kafka生产者性能监控:Monitor Kafka Producer for Performance
    kafka2.3性能测试:Kafka 2.3 Performance testing
    Tomcat 8 Invalid character found in the request target. The valid characters are defined in RFC 3986
    Springboot集成Mybatis、JPA
  • 原文地址:https://www.cnblogs.com/sharkHZ/p/4984176.html
Copyright © 2011-2022 走看看