美文网首页
ios textField 修改 placeholder col

ios textField 修改 placeholder col

作者: 江河_ios | 来源:发表于2018-01-15 14:23 被阅读0次

    使用UITextField的共有属性attributedPlaceholder

    self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeHolder attributes:@{NSForegroundColorAttributeName: YHGrayColor_51}];

    - (void)drawRect:(CGRect)rect

    {

        UIColor *color = [UIColor redColor];

        self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeHolder attributes:@{NSForegroundColorAttributeName: color}];

    }

    相关文章

      网友评论

          本文标题:ios textField 修改 placeholder col

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