UIColor
*color = [UIColor
blackColor];textField.attributedPlaceholder
= [[NSAttributedString
alloc]
initWithString:@"密码"
attributes:@{NSForegroundColorAttributeName:
color}];
本文介绍如何在iOS应用中使用UIColor为文本框的占位符设置颜色,包括初始化UIColor对象并应用于attributedPlaceholder的方法。
UIColor
*color = [UIColor
blackColor];textField.attributedPlaceholder
= [[NSAttributedString
alloc]
initWithString:@"密码"
attributes:@{NSForegroundColorAttributeName:
color}];
被折叠的 条评论
为什么被折叠?