我有 2 个并排的文本字段,countryCodeTextField 和 cellphoneTextField
在国家代码文本字段上。我有一个动作 selectCountry 发生在Edit Did Begin
countryCodeTextField
- (IBAction)selectCountry:(id)sender {
countryCodeTextField.delegate = self;
[countryCodeTextField resignFirstResponder];
- 请注意, self 实现了
<UITextFieldDelegate>
.
问题是当用户点击手机时,如果他点击 countryCodeTextField 键盘会显示,键盘永远不会被关闭。
如果此人首先单击国家代码,则键盘永远不会出现(这就是我想要的)。
为什么用户先点击cellphoneTextField再点击countryCodeTextField时键盘不隐藏?