修改UITextField输入字符颜色

用法
   cell.upField.attributedPlaceholder = [self changePlaceholderColorwith:@"请输入用户名" Range:NSMakeRange(0, 6)];

- (NSMutableAttributedString *)changePlaceholderColorwith:(NSString *)str Range:(NSRange)range{       

NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc]initWithString:str];   
 [attrString addAttribute:NSForegroundColorAttributeName  value:[UIColor colorWithHexString:@"#999999"]  range:range];   
  return attrString;
}

你可能感兴趣的:(修改UITextField输入字符颜色)