// // UserLoginAccountViewController.m // XenonSDK // // Created by SAGESSE on 2019/5/29. // Copyright © 2019 SAGESSE. All rights reserved. // #import "XenonSDK.h" #import "UserLoginAccountViewController.h" #import "UserRegisterAccountViewController.h" #import "NSBundle+KODLocalizable.h" #import "KODCommonConst.h" @interface UserLoginAccountViewController () @property(nonatomic,strong)UIView *listView; @end @implementation UserLoginAccountViewController -(void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; self.accountTextField.textColor = [UIColor blackColor]; self.passwordTextField.textColor = [UIColor blackColor]; //默认账号填充 XSUser *user = XSUser.history.firstObject; self.accountTextField.text = user.userName; } -(void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; [self.listView removeFromSuperview]; self.listView = nil; } - (IBAction)PullAccoutList:(UIButton *)sender { sender.selected = !sender.selected; if (sender.selected) { NSInteger count = XSUser.history.count; if (count >4) { count = 4; } [self setAccoutListWith:count]; }else{ [self.listView removeFromSuperview]; } } -(void)setAccoutListWith:(NSInteger)count { if (count == 0) { return; } if (self.listView) { [self.listView removeFromSuperview]; } self.listView = [[UIView alloc]init]; self.listView.frame = CGRectMake(self.accountInputView.frame.origin.x, self.accountInputView.frame.origin.y +self.accountInputView.frame.size.height*+1+3, self.accountInputView.frame.size.width, self.accountInputView.frame.size.height*count-(count-1)*1); self.listView.backgroundColor = [UIColor whiteColor]; self.listView.userInteractionEnabled = YES; [self.view addSubview:self.listView]; for (int i=0; i