修改UITextField的光标颜色
textField.tintColor = [UIColor whiteColor];
UITextField占位文字相关的设置
// 设置占位文字内容
@property(nullable, nonatomic,copy) NSString *placeholder;
// 设置带有属性的占位文字, 优先级 > placeholder
@property(nullable, nonatomic,copy) NSAttributedString *attributedPlaceholder;
修改UITextField占位文字的颜色
@property(nullable, nonatomic,copy) NSAttributedString *attributedPlaceholder;
- 重写- (void)drawPlaceholderInRect:(CGRect)rect;
- (void)drawPlaceholderInRect:(CGRect)rect;
[textField setValue:[UIColor grayColor] forKeyPath:@"placeholderLabel.textColor"];
网友评论