zoukankan      html  css  js  c++  java
  • 设置一个字符串中的个别字符的特殊格式

      颜色大小的特殊处理
     
        NSDictionary *consumDic = @{NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:[UIColor colorWithRed:255 green:255 blue:255 alpha:1.0]};
        NSDictionary *moneySignDic = @{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[UIColor colorWithRed:255 green:255 blue:255 alpha:1.0]};
        NSMutableAttributedString *mAttrString = [[NSMutableAttributedString alloc] initWithString:@"消费¥0.00/余额0.00" attributes:consumDic];
        [mAttrString addAttributes:moneySignDic range:NSMakeRange(2, 1)];
        [mAttrString addAttributes:moneySignDic range:NSMakeRange(8, 6)];
        consumLabel.attributedText = mAttrString;
  • 相关阅读:
    11
    10
    09
    08
    201621044079韩烨软件工程作业三
    软工作业二 201621044079韩烨
    软工作业一 201621044079韩烨
    14
    201621044079 week13 网络
    week12 201621044079 流与文件
  • 原文地址:https://www.cnblogs.com/tian-sun/p/5020027.html
Copyright © 2011-2022 走看看