我想为UITableviewcell设置一个图像,但imageview contentmode是UIViewContentModeScaleAspectFit,并且设置全宽取决于UI的宽度高度是更改的,如何做到这一点。
将UIIMageView
内容模式更改为UIViewContentModeScaleToFill
或UIViewContentModeScaleAspectFill
已编辑
使用以下UITableView's
方法
在NSMutableArray
中添加UIImageView
高度(高度阵列)
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [heightsArray objectAtIndex:indexpath.row];
}