0
点赞
收藏
分享

微信扫一扫

设置标签的attributedText和设置输入框的attributedPlaceholder


设置标签的attributedText

        NSString *str = @"修改后会影响物流时效、送货上门等服务,只能原价修改且付款后只能修改一次。若因商品换仓、已发货、运费变更等原因导致修改失败,请您谅解。";
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str];

[attributedString addAttribute:NSForegroundColorAttributeName value:BGColorHex(F7391F) range:NSMakeRange(0, 36)];
[attributedString addAttribute:NSForegroundColorAttributeName value:DEFAULT_TITLE_SUPER_FRONT_COLOR range:NSMakeRange(36, str.length-36)];
[attributedString addAttribute:NSFontAttributeName value:BGFont(11) range:NSMakeRange(0, str.length)];
_describeTitleLabel.attributedText = attributedString;

设置输入框的attributedPlaceholder

        NSMutableAttributedString *placeholderString = [[NSMutableAttributedString alloc] initWithString:placeholderStr attributes:@{NSFontAttributeName:BGFont(15),NSForegroundColorAttributeName:BGColorHex(999999)}];
_contentTextField.attributedPlaceholder = placeholderString;


举报

相关推荐

0 条评论