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

2018-04-03  本文已影响0人  WS_0909
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”
上一篇 下一篇

猜你喜欢

热点阅读