美文网首页
iOS开发 | 修改textField的placeholder的

iOS开发 | 修改textField的placeholder的

作者: _冇毒 | 来源:发表于2017-06-15 16:52 被阅读10次
    textField.placeholder = @"username is in here!";  
    [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];  
    [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];  
    

    textField的placeholder属于私有接口, 只能通过setValue forKey 的方法来更改

    相关文章

      网友评论

          本文标题:iOS开发 | 修改textField的placeholder的

          本文链接:https://www.haomeiwen.com/subject/hgluqxtx.html