首页 > 代码库 > UIAlertView

UIAlertView

http://blog.csdn.net/developer_zhang/article/details/8825822

1.普通弹框

      - (void)viewDidLoad 

     {  

             [super viewDidLoad];  

             UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title"  message:@"Message"  

                                                   delegate:nil  cancelButtonTitle:@"Cancel" 

                                                   otherButtonTitles:@"Ok", nil];  

             [alertView show]; 

     } 

2.带输入框的Alert

      加一行:[alertView setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

  • UIAlertViewStyleSecureTextInput//密码框  
  • UIAlertViewStylePlainTextInput//文本输入框