// WORKS: 按钮可以点击
_mode = [UIButton buttonWithType:UIButtonTypeCustom];
_textField.rightView = _mode;
_textField.rightViewMode = UITextFieldViewModeAlways;
// NOT WORK: 不知道为什么不能处理这样的tap事件
_mode 是 UIImageView
然后在_mode上面 addTapGuesture.
// WORKS: 按钮可以点击
_mode = [UIButton buttonWithType:UIButtonTypeCustom];
_textField.rightView = _mode;
_textField.rightViewMode = UITextFieldViewModeAlways;
// NOT WORK: 不知道为什么不能处理这样的tap事件
_mode 是 UIImageView
然后在_mode上面 addTapGuesture.