我想將UITextField.text的左邊距對齊到10Px。請建議我最好的辦法?在圓角矩形TesxtField相同,其中的文字從左至右重置UITextField左邊距
啓動10 PX已通過覆蓋幾乎達到 - (CGRect)textRectForBounds:(CGRect)bounds.
現在的問題是,當文本字段在進入到編輯模式的左邊距重置爲零.......
@implementation UITextField(UITextFieldCatagory)
- (CGRect)textRectForBounds:(CGRect)bounds {
CGRect theRect=CGRectMake(bounds.origin.x+10, bounds.origin.y, bounds.size.width-10, bounds.size.height);
return theRect;
}
它的工作就像魅力.thanks豪爾赫 – iOSPawan 2011-04-18 07:37:07