简体   繁体   中英

swift - UITableView section insets

I have design the screen like below image.

在此处输入图片说明

I wonder how I can inset margin in section like a blue area.

These are not cell spacing, header or footer height, layout margin.

You could have the cell's contentView 's backgroundColor set to clear and setup your UI elements however you want. That way it'll look as if the cell is indented.

Don't try to inset your whole TableView / TableViewCell . Create a container View inside your TableViewCell instead. And set margin for inner UIView

Currently, you can't do it with UITableView. There is no API for section insets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM