iOS7 UIAlertView

####iOS7 Programming Cookbook 第一章学习笔记 UIAlertView

#####Displaying Alerts with UIAlertView

#####ViewController.m

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- (void) viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
//创建alertView
UIAlertView *alertView = [[UIAlertView alloc]
//提示标题
initWithTitle:@"Password"
//提示话
message:@"Please enter your password:"
//协议
delegate:self
//取消
cancelButtonTitle:@"Cancel"
//确认
otherButtonTitles:@"Ok", nil];
//允许用户输入文本
[alertView setAlertViewStyle:UIAlertViewStyleSecureTextInput];
//展示
[alertView show];

}

Reference

坚持原创技术分享,您的支持将鼓励我继续创作!
0%