首页 > 代码库 > STAlertViewDemo
STAlertViewDemo
效果图:
工程图:
注意,此工程需要导入第三方库STAlertView
RootViewController.m
//点击任何处,弹出按钮-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self showTextFieldUIAlertView];}#pragma -mark -functions- (void)showNormalUIAlertView{ stAlertView = [[STAlertView alloc] initWithTitle:@"Super alert view" message:@"I‘m a native UIAlertView. Do you think I‘m useful?" cancelButtonTitle:@"No, ofc" otherButtonTitles:@"Yes a little bit" cancelButtonBlock:^{ NSLog(@"Why do you think I‘m not fancy :_( "); } otherButtonBlock:^{ NSLog(@"Great! Feel free to contribute or contact me at twitter @NestorMalet!"); }];}- (void)showTextFieldUIAlertView{ stAlertView = [[STAlertView alloc] initWithTitle:@"Alert view with a textfield" message:@"I‘m a native UIAlertView with a textfiled." textFieldHint:@"What do you think about me?" textFieldValue:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Store" cancelButtonBlock:^{ NSLog(@"Please, give me some feedback!"); } otherButtonBlock:^(NSString * result){ NSLog(@" You have said %@, but I can‘t store it :( . If you want, you can send it to me at hello@nestor.cat or via twitter @NestorMalet!", result); }];}
源代码网址:http://url.cn/LSIrox
STAlertViewDemo
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。