iOS textField 水印字体大小 颜色设置 ..Button 字体换行

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 水印字体大小 颜色设置 ..Button 字体换行)