search

Home  >  Q&A  >  body text

如何用swift代码修改ios里text field 里注释文字的颜色深浅

如何用swift代码修改ios里text field 里注释文字的颜色深浅
现在的自带文字看不清楚

ringa_leeringa_lee2841 days ago731

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 14:32:21

    You can try this:

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

    But obviously this method is not publicly supported, so it may not be effective in future versions of iOS. To be safe, don't use the default placeHolder, write a label yourself and put it there.

    reply
    0
  • Cancelreply