UITextField set placeholder color as dark in iOS

前端 未结 8 755
误落风尘
误落风尘 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:37

    It will change textField's palceholder textColor

    [yourTextField setValue:[UIColor colorWithRed:150.0f/255.0f green:150.0f/255.0f blue:155.0f/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];
    

提交回复
热议问题