修改UITextfield的Placeholder字体的颜色

来源:互联网 发布:淘宝卖家地址怎么看 编辑:程序博客网 时间:2024/05/16 10:58

//第一种   UIColor *color = [UIColor whiteColor];    _userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名" attributes:@{NSForegroundColorAttributeName: color}];//第二种 [_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];



6 0
原创粉丝点击