设置UITextField的占位符

  占位符的字体的颜色,大小设置。

UITextField *textField = [[UITextField alloc] init];

UIFont *font = [UIFont systemFontOfSize:12];

UIColor *color =[UIColor whiteColor];

textField.textAlignment = NSTextAlignmentCenter;

// 没错,就是看接下来这一步了。

textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"设置颜色和大小" attributes:@{NSFontAttributeName:font, NSForegroundColorAttributeName:color}];

你可能感兴趣的:(color,字体,占位符,UITextField,字体颜色大小)