您的位置:首页 > 产品设计 > UI/UE

stretchableImageWithLeftCapWidth 自动适应UITableView

2012-09-10 22:34 489 查看
//当用到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;


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: