UITextField的RightView没有相同的目标

时间:2014-04-18 13:48:38

标签: ios uiview uitextfield rightview

我有一个自定义UITextFieldrightView包含带有绘制矩形(箭头)图像的自定义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

我将此自定义textField与自定义UIView作为righView。即使用户点击了didBeginEditing,我也想点rightView

提前致谢。

0 个答案:

没有答案
相关问题