【发布时间】:2014-09-11 08:41:58
【问题描述】:
到目前为止我有:
var imageView = UIImageView(frame: CGRectMake(10, 10, cell.frame.width - 10, cell.frame.height - 10))
let image = UIImage(named: ImageNames[indexPath.row])
imageView.image = image
cell.backgroundView = imageView
这设置了背景图像,但我的目标是在两边都有 10 像素的填充。这只是用这张图片填充单元格的背景。
【问题讨论】:
-
然后不要将您的图像视图指定为背景视图。使用您想要的框架定义您的图像视图,然后将其添加到现有的背景视图或内容视图(根据您的需要)。
-
@0x7fffffff 我不是已经用我想要的框架定义了它,然后将它添加到现有的背景视图中吗?
标签: ios swift uitableview uiimageview