Change of UITextField placeholder color

后端 未结 13 1555
别跟我提以往
别跟我提以往 2021-01-30 06:09

How to dynamically change placeholder color of the UITextField? This is always the same system color.

No option in xib editor.

13条回答
  •  梦谈多话
    2021-01-30 06:44

    Use below code

    [YourtextField setValue:[UIColor colorWithRed:97.0/255.0 green:1.0/255.0 blue:17.0/255.0 alpha:1.0] forKeyPath:@"_placeholderLabel.textColor"];
    

提交回复
热议问题