码迷,mamicode.com
首页 > 其他好文 > 详细

带输入框的UIAlertView

时间:2015-04-22 18:17:17      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:带输入框的uialertview

UITextField * textFiled1;

UITextField * textFiled2;


UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"请输入" message:@"账号和密码" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];

    alert.tag = 100;

    alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;

     textFiled1 = [alert textFieldAtIndex:0];

    textFiled1.keyboardType = UIKeyboardTypeNumberPad;

    textFiled2 = [alert textFieldAtIndex:1];


    [alert show];


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


    if (alertView.tag == 100 && buttonIndex == 1) {

        self.lab1.text = textFiled1.text;

        self.lab2.text = textFiled2.text;

    }


}


带输入框的UIAlertView

标签:带输入框的uialertview

原文地址:http://blog.csdn.net/heyachaodeios/article/details/45197435

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!