黑马程序员技术交流社区
标题:
仿QQ登入界面(高仿版)
[打印本页]
作者:
叶子哥
时间:
2016-6-12 12:30
标题:
仿QQ登入界面(高仿版)
先看效果:
仿QQ登入界面.gif
(166.36 KB, 下载次数: 50)
下载附件
2016-6-12 12:27 上传
主要代码如下:
@implementation ViewController
- (IBAction)loadingBtn:(UIButton *)sender {
[self.view endEditing:YES];
NSString *QQNumber = self.qqNumber.text;
NSString *QQPwd = self.pwd.text;
NSLog(@"用户QQ号码是:%@, 密码:%@",QQNumber,QQPwd);
if ([QQNumber isEqualToString:@"123456"] && [QQPwd isEqualToString:@"qwert"]) {
sender.hidden = YES;
self.act.hidden = NO;
self.showLoadLabel.hidden = NO;
[self.act startAnimating];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self showLoadedSuccess];
});
}else{
//创建弹框
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"密码或账号不正确" preferredStyle:UIAlertControllerStyleAlert];
self.alert = alert;
//给弹框添加按钮
UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击了");
}];
[alert addAction:alertAction];
//显示弹框
[self presentViewController:alert animated:YES completion:^{
NSLog(@"点击了");
}];
}
}
- (void)showLoadedSuccess{
[self.act stopAnimating];
[self.showLoadLabel setText:@"登入成功"];
self.act.hidden = YES;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.act.hidden = YES;
self.showLoadLabel.hidden = YES;
}
复制代码
作者:
dayuanzhang
时间:
2016-6-12 17:49
楼主棒棒哒
作者:
王大懂
时间:
2016-12-6 21:08
楼主,为什么没有下拉菜单选择用户呢
作者:
zhao543
时间:
2017-5-2 21:30
东西是好东西,希望再接再厉
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2