The height of each cell is a little higher (higher than the spacing you want), the cell background is set to transparent, use your own view as the background, do not fill the cell, and leave the height you exceed
You can set multiple sections. Each section has one cell, so the distance between cells becomes the distance between sections. Is it difficult to set the distance between sections?
The method on the first floor is the most reliable. The performance of collectionView is relatively poor. It is more cost-effective to set more blanks in the cell.
You mean. . Just like in Weibo. . Does it seem like there are gaps between each cell?
Stupid method, set a little blank area in each cell X D
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
The height of each cell is a little higher (higher than the spacing you want), the cell background is set to transparent, use your own view as the background, do not fill the cell, and leave the height you exceed
UITableView
只能通过间接的方式设置出来。如果想更完美智能地设置cell间距,建议你使用
UICollectionView
It would be better if you use
heightForRowAtIndexPath:
to leave a little more height...You can set multiple sections. Each section has one cell, so the distance between cells becomes the distance between sections.
Is it difficult to set the distance between sections?
The method on the first floor is the most reliable. The performance of collectionView is relatively poor. It is more cost-effective to set more blanks in the cell.
Rewrite the setFrame method of cell
MessageCellSectionMargin customizes a value