ios modify the color of the placeholder of UITextView

Problem solving address:

 

http://stackoverflow.com/questions/26076054/changing-placeholder-text-color-with-swift

 

1. As shown below, add  _placeholderLabel.textColor

 

 

2. Use code

textFld.attributedPlaceholder =NSAttributedString(string:"Test Data for place holder", attributes:[NSForegroundColorAttributeName:UIColor.blueColor(),NSFontAttributeName:UIFont(name:"Arial", size:10)!])

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326941278&siteId=291194637