zoukankan      html  css  js  c++  java
  • IOS问题汇总:2012-12-18 UIAlertView+UIActionSheet

    UIAlertView/UIActionSheet

    UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@“添加场景模式” message:@“请输入场景名称” delegate:self cancelButtonTitle:@“取消” otherButtonTitles:@“确定”, nil];
    alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
    UITextField * tf = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, alertView.frame.size.width, 44)];

        tf.borderStyle = UITextBorderStyleRoundedRect;
    
        /*    UITextBorderStyleNone,
         UITextBorderStyleLine,
         UITextBorderStyleBezel,
         UITextBorderStyleRoundedRect*/
        //        tf.placeholder = detailText;
        //        NSLog(@"tf.text--%@",tf.text);
        //        tf.delegate = self;
        //        tf.borderStyle = UITextBorderStyleRoundedRect;
        [alertView addSubview:tf];
    
        [alertView show];
    

    ——alertView自动消失
    -(void) performDismiss:(NSTimer *)timer
    {
    [Alert dismissWithClickedButtonIndex:0 animated:NO];
    [Alert release];
    }

    -(void)presentSheet
    {
    Alert = [[UIAlertView alloc] initWithTitle:@“警告” message:@“出错啦!” delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];

    [NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:<a href="http://www.twitter.com/selector">@selector</a>(performDismiss:) userInfo:nil repeats:NO];
    [Alert show];
    

    }

    UIActionSheet *as = [[UIActionSheet alloc]initWithTitle:[NSString stringWithFormat:@“添加%@”,actionSheetTitle] delegate:self cancelButtonTitle:@“取消” destructiveButtonTitle:nil otherButtonTitles:actionSheetButtonTitle ,nil];

        /*
         UIActionSheetStyleAutomatic        = -1,       // take appearance from toolbar style otherwise uses 'default'
         UIActionSheetStyleDefault          = UIBarStyleDefault,
         UIActionSheetStyleBlackTranslucent = UIBarStyleBlackTranslucent,
         UIActionSheetStyleBlackOpaque      = UIBarStyleBlackOpaque,
         */
        //    as.actionSheetStyle = UIActionSheetStyleBlackOpaque;
        [as showInView:self.view];
  • 相关阅读:
    <转>WCF中出现死锁或者超时
    无连接服务器与面向连接的服务器
    Linux系统调用
    vim文本删除方法 Linux
    深入了解C指针
    linux下c语言实现双进程运行
    *p++、(*p)++、*++p、++*p 的区别
    快速了解yuv4:4:4 yuv4:2:2 yuv 4:1:1 yuv 4:2:0四种YUV格式区别
    文件通过svn updata更新不到,并且svn st显示被删除的解决办法
    [非常重要的总结] Linux C相关函数
  • 原文地址:https://www.cnblogs.com/hanyutong/p/4425196.html
Copyright © 2011-2022 走看看