以下都不应直接调用,需要的话可以重写
– textRectForBounds: //重写来重置文字区域
– drawTextInRect: //改变绘文字属性.重写时调用 super 可以按默认图形属性绘制,
若自己完全重写绘制函数,就不用调用
super 了.
– placeholderRectForBounds: //重写来重置占位符区域
– drawPlaceholderInRect: //重写改变绘制占位符属性.重写时调用 super 可以按默
认图形属性绘制
,若自己完全重写绘制函数,就不用调用 super 了.
– borderRectForBounds: //重写来重置边缘区域
– editingRectForBounds: //重写来重置编辑区域
– clearButtonRectForBounds: //重写来重置 clearButton 位置,改变 size 可能导致
button 的图片失真
– leftViewRectForBounds:
– rightViewRectForBounds:
代替输入
inputView //代替标准的系统键盘
inputAccessoryView //编辑时显示在系统键盘或用户自定义的 inputView 上面
的视图
UITextFieldBorderStyle
1
typedef enum {
2
UITextBorderStyleNone,//无框
3
UITextBorderStyleLine,//线框
4
UITextBorderStyleBezel,//bezel 风格线框
5
UITextBorderStyleRoundedRect//圆角边框
6
} UITextBorderStyle;
复制代码
UITextFieldViewMode
7
typedef enum {
8
UITextFieldViewModeNever,
9
UITextFieldViewModeWhileEditing,
10 UITextFieldViewModeUnlessEditing,
11 UITextFieldViewModeAlways
12 } UITextFieldViewMode;
复制代码