2018-05-17
2018-05-17 本文已影响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]];