UITextField set placeholder color as dark in iOS

前端 未结 8 754
误落风尘
误落风尘 2021-02-01 10:59

I have tried to set UITextField \"Placeholder\" color as dark.

NSAttributedString * search = [[NSAttributedString alloc] initWithSt         


        
8条回答
  •  独厮守ぢ
    2021-02-01 11:18

    Try this

     [textField setValue:[UIColor blackColor] forKeyPath:@"_placeholderLabel.textColor"];
    

提交回复
热议问题