修改UITextfield的Placeholder字体的颜色

//第一种   
   
 UIColor *color = [UIColor whiteColor];  
    _userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名" attributes:@{NSForegroundColorAttributeName: color}];  
  
  
//第二种   
[_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];

 

posted on 2015-11-06 11:10  进化的蜗牛  阅读(108)  评论(0编辑  收藏  举报