设置UITextField的placeholder颜色
UIColor *color = [UIColor blackColor];
textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSForegroundColorAttributeName: color}];
本文介绍如何使用NSAttributedString设置UITextField的placeholder颜色。通过设置NSAttributedString的NSForegroundColorAttributeName属性为UIColor对象,可以改变 UITextField placeholder 的显示颜色。
设置UITextField的placeholder颜色
UIColor *color = [UIColor blackColor];
textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSForegroundColorAttributeName: color}];
转载于:https://www.cnblogs.com/Ewenblog/p/3891782.html

被折叠的 条评论
为什么被折叠?