UIAlertView
来源:互联网 发布:java可变参数写法 编辑:程序博客网 时间:2024/05/16 15:33
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"password"
message:@"please enter your password:"
delegate:self
cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
[alert show];
UIAlertView 的属性alertViewStyle
ypedef enum {
UIAlertViewStyleDefault = 0,UIAlertViewStyleSecureTextInput,UIAlertViewStylePlainTextInput,UIAlertViewStyleLoginAndPasswordInput} UIAlertViewStyle;
若类实现UIAlertViewDelegate协议
为此需要实现alertView:clickedButtonAtIndex方法:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
self.result.text = [NSString stringWithFormat:@"You selected: '%@'",[alertView buttonTitleAtIndex:buttonIndex]];
}
- (IBAction)buttonPress:(id)sender {
if (sender == self.button1) {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Error" message:@"Unable to reach server" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease];
[alert show];
} else if (sender == self.button2) {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Submit Score"message:@"We'd like to submit your high score to the global scoreboard"
[alert show]; }
}
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIalertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- 「祖」prototype //原型对象的引用 20140804 ①文本处理
- Maven2之 report常用plugin
- 修改织梦文章标题字数限制的问题
- JS定制弹出窗口的居中方法
- Object-C 声明属性为什么用下划线,代码规范和编程风格
- UIAlertView
- 如何在CentOS中把网卡设置成动态获取IP
- Android情景分析之深入解析zygote
- 百度地图URI API,调用位置、导航模块,移动端
- android--友盟自动更新配置说明
- 构建模式
- 接口初步理解
- 史上最全的iOS面试题及答案
- hdu1102:Constructing Roads(prime)