美文网首页
2018-05-17

2018-05-17

作者: 木_风 | 来源:发表于2018-05-17 16:05 被阅读14次

    1.需求修改UIAlertController中title

    [alertControllersetValue:[selfattributedString:titleString]forKey:@"attributedTitle"];

    - (NSAttributedString*)attributedString:(NSString*)string

    {

        NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:string];

        // 添加表情

        NSTextAttachment *attch = [[NSTextAttachment alloc] init];

        // 表情图片

        attch.image = [UIImage imageNamed:@"bt_add_select"];

        // 设置图片大小

        attch.bounds=CGRectMake(0, -6,26,26);

        // 创建带有图片的富文本

        NSAttributedString *attributedString = [NSAttributedString attributedStringWithAttachment:attch];

        [attriinsertAttributedString:attributedStringatIndex:12];

       return  attri;

    }

    2.tableviewcell 向上滚动cell的contentview的颜色被cell的颜色盖住

        [cell setBackgroundColor:[UIColor clearColor]];

    相关文章

      网友评论

          本文标题:2018-05-17

          本文链接:https://www.haomeiwen.com/subject/czbbdftx.html