zoukankan      html  css  js  c++  java
  • 进击的UI-------------UIAlertView(警告)

    // UIAlertView的常用方法
    // 标准样式
    UIAlertView *oneAlertView = [[UIAlertView alloc] initWithTitle:@"标题" message:@"提示内容" delegate:self cancelButtonTitle:@"关闭" otherButtonTitles:@"OK", nil];
    [oneAlertView show]; // 显示出来
    [oneAlertView release], oneAlertView = nil; // 释放内存
    oneAlertView.alertViewStyle = UIAlertViewStyleDefault; // 设置oneAlerView的样式
    //    UIAlertViewStyleDefault 只弹信息和按钮
    //    UIAlertViewStyleSecureTextInput 有一个textfield加密框
    //    UIAlertViewStylePlainTextInput 有一个不加密的textfield
    //    UIAlertViewStyleLoginAndPasswordInput 有两个textfield,Login和password
     
    IOS--UIAlertView的使用方法详细
    // 按钮横排显示
    UIAlertView *twoAlertView = [[UIAlertView alloc] initWithTitle:@"标题" message:@"提示内容" delegate:self cancelButtonTitle:@"关闭" otherButtonTitles:@"按钮1", @"按钮2", @"按钮2", nil];
    [twoAlertView show]; // 显示出来
    [twoAlertView release], twoAlertView = nil; // 释放内存
     
    IOS--UIAlertView的使用方法详细
    // 添加了多个按钮,那么要怎么判断我们按下的是哪个按钮呢?
    // 需要在.h文件中实现UIAlertViewDelegate代理,然后在.m文件中重写下面的方法
    #pragma mark - 实现UIAlertView的代理方法判断按了哪个按钮
    - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
        // 获取您按下的是哪个按钮
        NSString* msg = [[NSString alloc] initWithFormat:@"您按下的第%d个按钮!",buttonIndex];
        NSLog(@"%@", msg);
        [msg release], msg = nil;
    // 点击“取消”,“按钮1”,“按钮2”,“按钮3”的索引buttonIndex分别是0,1,2,3
    }
       // 给UIAlertView添加其他
    UIAlertView*alert = [[UIAlertView alloc]initWithTitle:@"请等待” message:nil delegate:nil                                                  cancelButtonTitle:nil otherButtonTitles:nil];
    [alert show];
    UIActivityIndicatorView *activeView = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    activeView.center = CGPointMake(alert.bounds.size.width/2.0f, alert.bounds.size.height-40.0f);
    [activeView startAnimating];
    [alert addSubview:activeView];
    [activeView release];
    [alert release];
     
    IOS--UIAlertView的使用方法详细
  • 相关阅读:
    wepy根据下标对数组中的某个对象的元素进行赋值
    wepy中的this.$apply()在什么时候使用
    wepy的安装与卸载
    vue-cli4.0更新后怎样将eslint关闭
    vue报错error 'projectName' is defined but never used no-unused-vars
    js数组对象去重(同时判断对象中的每一个属性,若其对应的属性值都相同,则去重)
    数字金额变为大写
    通过navigator.userAgent判断浏览器类型
    js获取iframe中的元素以及在iframe中获取父级的元素(包括iframe中不存在name和id的情况)
    html转成pdf,下载(html2canvas 和 jsPDF)
  • 原文地址:https://www.cnblogs.com/sharkHZ/p/4984154.html
Copyright © 2011-2022 走看看