-(id)initWithFrame:(CGRect)frame Icon:(UIImageView*)icon
{
self = [super initWithFrame:frame];
if (self) {
self.leftView = icon;
self.leftViewMode = UITextFieldViewModeAlways;
}
return self;
}
-(CGRect) leftViewRectForBounds:(CGRect)bounds {
CGRect iconRect = [super leftViewRectForBounds:bounds];
iconRect.origin.x += 10;// 右偏10
return iconRect;
}
网友评论