• IOS艺术字及简单的图文混排


            NSString* alertText = [NSString stringWithFormat:@" 以下%d节课程(总课酬¥%.02lf)家长们尚未结课并评价,请尽快联系家长,否则无法获取课酬。",self.courseNum,self.totalPrice];
            NSMutableAttributedString* alertString = [[NSMutableAttributedString alloc]initWithString:alertText];
            NSRange totalRange = NSMakeRange(0, alertString.length);
            [alertString addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16.0],NSForegroundColorAttributeName:[UIColor themePinkColor]} range:totalRange];
        //文字前边加一个图标 NSTextAttachment
    * textAttachment = [[NSTextAttachment alloc]initWithData:nil ofType:nil]; UIImage* alertIcon = [ UIImage imageNamed:@"lesson_icon26"]; textAttachment.image = alertIcon; textAttachment.bounds = CGRectMake(0,-5, kAlertIconHeight, kAlertIconHeight); [alertString insertAttributedString:[NSAttributedString attributedStringWithAttachment:textAttachment] atIndex:0]; self.alertLabel.attributedText = alertString;
  • 相关阅读:
    parted分区流程操作
    配置sudo命令行为审计
    sudo详细介绍
    groupadd(创建组)重要参数介绍
    useradd常用参数介绍
    /etc/default/useradd文件内容及对应功能
    linux基础正则
    centos 7.5 安装mongodb
    centos 7.5 安装mysql
    php删除制定文件及文件夹
  • 原文地址:https://www.cnblogs.com/guoxiaoqian/p/4659012.html
Copyright © 2020-2023  润新知