iOS 輸入框-提示文字

在 iOS 6+ 以上,針對輸入框提供了attributedPlaceholder來設置提示文字的顏色.

使用方式
UITextField *nameText
UIColor *color = [UIColor grayColor];

nameText.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:@”Full Name”
attributes:@{NSForegroundColorAttributeName:color}];

作者

Nick Lin

發表於

2021-03-09

更新於

2023-01-18

許可協議


評論