美文网首页
iOS textField 水印字体大小 颜色设置 ..Butt

iOS textField 水印字体大小 颜色设置 ..Butt

作者: WS_0909 | 来源:发表于2018-04-03 16:49 被阅读0次
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”

相关文章

网友评论

      本文标题:iOS textField 水印字体大小 颜色设置 ..Butt

      本文链接:https://www.haomeiwen.com/subject/jsrchftx.html