0
你好我试图让我的两个UITextFields的键盘在用户点击键盘时隐藏。我需要两个文本域都有相同的方法。我怎样才能做到这一点,而不复制它们并给Xcode和错误? 谢谢!两个具有相同隐藏方法的UITextFields
下面是我用于我的第一个textfield的方法,我需要我的另一个相同的方法。
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if ([text1 isFirstResponder] && [touch view] != text1) {
[text1 resignFirstResponder];
}
[super touchesBegan:touches withEvent:event];
}
你试过了什么? – greymouser