How to give space between two cells in tableview?

前端 未结 26 1534
谎友^
谎友^ 2020-11-29 00:11

I want a space between two cell in table view,

I want cell like this,

\"enter<

26条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 01:07

    I have used a simple and quick approach for this (using storyboard)

    • Add UITableView in your controller
    • Set the separator style to none (from attributes inspector)
    • Set the height of the row 5 pts more from top and bottom from the desired height
    • Now add an image in the cell, pin it from left and right but leave 5 pts space (for padding like feel) and set the background of the image same as the background you want for cell

    When the table view will be loaded, it will feel like there are spaces between cells.

提交回复
热议问题