NSString * holderText = @"请输入原密码";
NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:holderText]; [placeholder addAttribute:NSForegroundColorAttributeName value:kRGB_HEX(0x1F2936) range:NSMakeRange(0, holderText.length)];
[placeholder addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:16] range:NSMakeRange(0, holderText.length)];
_old_pw_TF.attributedPlaceholder = placeholder;
//UIbutton的换行显示
button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
//然后如同title的内容用包含“\n”就会换行
title = @“123\n666”
未经允许不得转载:作者:SheaYang,
转载或复制请以 超链接形式 并注明出处 技术狗|博客。
原文地址:《iOS textField 水印字体大小 颜色设置 ..Button 字体换行》 发布于2019-12-03
评论 抢沙发