//当用到UITableView 时。往往背景图片要根据内容的大小而定。但如果不用stretchableImageWithLeftCapWidth。刚图片拉出来会很难看。 //图片自动适应内容大小 UIImage *chatImage=[UIImage imageNamed:@"bubble.png"]; chatImage = [chatImage stretchableImageWithLeftCapWidth:22 topCapHeight:14]; NSLog(@"tbvContentSizeForLines:%f",tbvContentSizeForLines.width); cell.resultChatImageView.frame = CGRectMake(10, 44, tbvContentSizeForLines.width+25, cell.resultPersonTbvContent.numberOfLines*26+8); cell.resultChatImageView.image = chatImage;
转载于:https://www.cnblogs.com/qingjoin/archive/2012/09/10/2679461.html