Skip to content

Commit a1fff22

Browse files
committed
优化 项目设置 - 删除项目 密码对话框键盘操作
1 parent 7a6d9aa commit a1fff22

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

Coding_iOS/Controllers/ProjectSetting/ProjectAdvancedSettingViewController.m

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#import <UIView+SDCAutoLayout.h>
1515
#import "ProjectDeleteAlertControllerVisualStyle.h"
1616

17-
@interface ProjectAdvancedSettingViewController ()
17+
@interface ProjectAdvancedSettingViewController ()<UITextFieldDelegate>
1818

1919
@end
2020

@@ -80,15 +80,14 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
8080
passwordTextField.layer.borderWidth = 1;
8181
passwordTextField.secureTextEntry = YES;
8282
passwordTextField.backgroundColor = [UIColor whiteColor];
83+
passwordTextField.delegate = self;
8384

8485
[alert.contentView addSubview:passwordTextField];
8586

8687
NSDictionary* passwordViews = NSDictionaryOfVariableBindings(passwordTextField);
8788

8889
[alert.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[passwordTextField]-(>=14)-|" options:0 metrics:nil views:passwordViews]];
8990

90-
[passwordTextField becomeFirstResponder];
91-
9291
// Style
9392
alert.visualStyle = [ProjectDeleteAlertControllerVisualStyle new];
9493

@@ -115,7 +114,15 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
115114
}
116115
}]];
117116

118-
[alert presentWithCompletion:nil];
117+
[alert presentWithCompletion:^{
118+
[passwordTextField becomeFirstResponder];
119+
}];
120+
}
121+
122+
123+
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
124+
[textField resignFirstResponder];
125+
return YES;
119126
}
120127

121128
@end

0 commit comments

Comments
 (0)