ios textField 修改 placeholder col

2018-01-15  本文已影响0人  江河_ios

使用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}];

}

上一篇下一篇

猜你喜欢

热点阅读