#define iOS8Later ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)
@interface RootViewController ()<UIAlertViewDelegate> @end
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"登陆失败" message:@"请重新输入用户名和密码" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
#pragma mark - UIAlertView Delegate Methods -
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
{
NSLog(@"点击取消按钮后,想要的操作,可以加此处");
}
else if(buttonIndex == 1)
{
NSLog(@"点击确定按钮后,想要的操作,可以加此处");
}
}
UIAlertController *_alertVC = [UIAlertController alertControllerWithTitle:@"登陆失败" message:@"请重新输入用户名和密码" preferredStyle:UIAlertControllerStyleAlert];
//警告类型,红色字体 UIAlertActionStyleDestructive
// UIAlertAction *_doAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:nil];
// [_alertVC addAction:_doAction];
UIAlertAction *_doAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action)
{
NSLog(@"点击确定按钮后,想要的操作,可以加此处");
}];
[_alertVC addAction:_doAction];
// UIAlertAction *_cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
// [_alertVC addAction:_cancleAction];
UIAlertAction *_cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action)
{
NSLog(@"点击取消按钮后,想要的操作");
}];
[_alertVC addAction:_cancleAction];
[self presentViewController:_alertVC animated:YES completion:nil];
//警告类型,红色字体 UIAlertActionStyleDestructive,如下图所示的效果
UIAlertAction *_doAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:nil];
[_alertVC addAction:_doAction];
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有