我正在试图添加一个背景图像到UITableViewCell,以便每个单元格可以在底部有一些间距。如何防止UITableViewCell backgroundView拉伸
我设置单元格的backgroundView属性是这样的:
[cell setBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell"]]];
的“细胞”的图像比的UITableViewCell的实际HEIGH 20像素高,这是故意让自己的细胞可以有一些间距在底部。唯一的问题是,“单元格”图像会一直延伸到单元格的contentView。
有没有一种方法可以防止单元格拉伸backgroundView一直向下?
在此先感谢!
这应该是正确的答案。 'UIImageView'只服从'contentMode'的值,默认为'UIViewContentModeScaleToFill' –