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;
  • 相关阅读:
    读取csv遇到的双循环
    hadoop环境配置
    mysql的查询
    mysql的基本操作
    mysql与python的交互
    设置自动获取IP和DNS
    pyecharts绘制地图
    集合 set方法
    字符串 string方法
    字典 dict方法
  • 原文地址:https://www.cnblogs.com/tian-sun/p/5020027.html
Copyright © 2011-2022 走看看