<pre name="code" class="objc">//UITextField修改placeholder的字体大小 ,颜色
NSString *holderText =@"Hello,world";
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:holderText];
[placeholder addAttribute:NSFontAttributeName
value:[UIFont boldSystemFontOfSize:15]
range:NSMakeRange(0, holderText.length)];
[placeholder addAttribute:NSForegroundColorAttributeName
value:[UIColor redColor]
range:NSMakeRange(0, holderText.length)];
textFeild.attributedPlaceholder =placeholder;
(iOS开发)修改UITextField中placeholder的字体大小,颜色
最新推荐文章于 2021-07-05 18:28:58 发布