textfield

2018-01-17  本文已影响5人  赤焰军少帅林殊

import "ZYTextField.h"

@implementation ZYTextField

//控制placeHolder的位置
-(CGRect)placeholderRectForBounds:(CGRect)bounds
{
CGRect inset = CGRectMake(bounds.origin.x+15kRating, bounds.origin.y, bounds.size.width -15kRating, 30*kRating);
return inset;
}

//控制显示文本的位置
-(CGRect)textRectForBounds:(CGRect)bounds
{
CGRect inset = CGRectMake(bounds.origin.x+15, bounds.origin.y, bounds.size.width -15, bounds.size.height);
return inset;
}

//控制编辑文本的位置
-(CGRect)editingRectForBounds:(CGRect)bounds
{
CGRect inset = CGRectMake(bounds.origin.x +15, bounds.origin.y, bounds.size.width -15, bounds.size.height);
return inset;
}

上一篇下一篇

猜你喜欢

热点阅读