uitextfield placehold 顏色

  1. //第一種   
  2.    
  3.  UIColor *color = [UIColor whiteColor];  
  4.     _userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用戶名" attributes:@{NSForegroundColorAttributeName: color}];  
  5.   
  6.   
  7. //第二種   
  8. [_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];  

發佈了100 篇原創文章 · 獲贊 216 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章