横向单元格空间表视图 Swift [英] lateral cell space tableview Swift

查看:22
本文介绍了横向单元格空间表视图 Swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有各种单元格的 UITableView,我想在单元格和 View 之间插入横向空间(向右和向左),但我是不能那样做.有人能帮我解决这个问题吗?

I have a UITableView with various cells and I want to insert lateral space (to the right and to the left) between the cell and the View, but I am not able to do that. Can anyone help me with this?

推荐答案

一种方法是使 TableView 的宽度比控制器的视图宽度更短,并添加约束以保持空间完全符合您的要求.

One way is to make the TableView's width shorter that the controller's view width and add constraints to keep the space exactly as you want it.

另一种方法是使用内部容器"来设计您的单元格,并在单元格内容视图的边缘留有间距.

Another way is to design your cell with an "internal container" with spacings to edge of the cell's content view.

这篇关于横向单元格空间表视图 Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆