2018-05-17

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]];

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。