首行缩进可以利用textfield的leftView做事
UILabel *usernameLeftView = [[UILabel alloc] initWithFrame:CGRectMake(0.f, 0.f, 10.f, 0.f)];
usernameLeftView.backgroundColor = [UIColor clearColor];
textField.leftView = usernameLeftView;
光标颜色:textField.tintColor = [UIColor blackColor];
清除样式:textField.clearButtonMode = UITextFieldViewModeWhileEditing;(常用方法)
typedef NS_ENUM(NSInteger, UITextFieldViewMode) {
UITextFieldViewModeNever,//从不
UITextFieldViewModeWhileEditing,//编辑时
UITextFieldViewModeUnlessEditing,//不在编辑状态时
UITextFieldViewModeAlways//总是
};
最终样式:加了边框的