我有一个自定义UITextField,其中rightView包含一个UIView带有绘制矩形(箭头)图像的自定义。我怎样才能得到与leftView火相同的动作textfield?
@implementation CustomDropDownTextField
-(id)initWithCoder:(NSCoder *)aDecoder {
if(self = [super initWithCoder:aDecoder]) {
// Border Color of the UITextField - light gray
self.delegate = self;
self.layer.borderColor = [[UIColor colorWithRed: 0.827 green: 0.827 blue: 0.827 alpha: 1] CGColor];;
self.layer.borderWidth= 1.0f;
self.rightView = [CustomDateDropDownArrowView default];
self.rightViewMode = UITextFieldViewModeAlways;
}
return self;
}
@end
我有这个自定义文本字段,自定义UIView为righView. didBeginEditing即使用户点击它,我也只想开火rightView。
提前致谢。