相关疑难解决方法(0)

如何在UITableViewCell之间添加间距

有没有办法增加间距UITableViewCell

我创建了一个表,每个单元格只包含一个图像.图像被分配给单元格,如下所示:

cell.imageView.image = [myImages objectAtIndex:indexPath.row];
Run Code Online (Sandbox Code Playgroud)

但这会使图像放大并适合整个单元格,图像之间没有间距.

或者以这种方式说,图像的高度例如是50,并且我想在图像之间添加20个间隔.有没有办法实现这个目标?

objective-c uitableview ios

163
推荐指数
14
解决办法
22万
查看次数

xcode 8 swift 3 UItable查看单元格之间的空间?

我试图在单元格之间留出空间UItableview我已经检查了谷歌我发现的所有帖子都超过3年,当我尝试应用它们时我得到了这么多错误,是否有可能在单元格之间留出空间UItableview

我的代码:

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "ImageCell") as! ImageCell
    cell.model = self.modelAtIndexPath(indexPath)

    let url = URL(string: cell.model.imageName)
    cell.imgBack.kf.setImage(with: url)

    return cell
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

    //send back playlist count
    if (section == 0) {
        return self.lists_arr.count
    }
    return 0
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    tableView.deselectRow(at: indexPath, animated:true)
}

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, …
Run Code Online (Sandbox Code Playgroud)

iphone xcode uitableview ios

9
推荐指数
5
解决办法
2万
查看次数

标签 统计

ios ×2

uitableview ×2

iphone ×1

objective-c ×1

xcode ×1