UITextField set placeholder color as dark in iOS

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

    Its very simple....

    Try this to change placeholder text color..

    UIColor *color = [UIColor blackColor];
    textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholderText attributes:@{NSForegroundColorAttributeName: color}];
    

提交回复
热议问题