iOS UITextfield

2020-09-04  本文已影响0人  Joymerry

1.设置UITextfield光标颜色

self.editTF.tintColor = ColorRGB(255, 171, 52);

2.设置UITextfield文本向右偏移

self.editTF.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 10, 0)];
self.editTF.leftViewMode = UITextFieldViewModeAlways;
  1. 自定义UITextfield清除按钮
 UIButton *cleanBtn = [self valueForKey:@"_clearButton"];
 [cleanBtn setImage:[UIImage imageNamed:@"edit_delete"] forState:UIControlStateNormal];
上一篇 下一篇

猜你喜欢

热点阅读