Adding a view (image view) in between two UITableViewCells

后端 未结 2 1190
予麋鹿
予麋鹿 2021-01-24 06:31

I have created a UITableView programatically. And i am loading it with data. I want to insert an advertisement Banner (clickable button which is equal to cell\'s he

相关标签:
2条回答
  • 2021-01-24 06:38

    As Duncan mentioned you could use cellForRowAtIndexPath and place a custom cell type for every 4th row. You can set two types of custom cells in your tableview by setting the identifier property. Ex. For every 4th row use the "ad" identifier cell.

    0 讨论(0)
  • 2021-01-24 06:50

    No, it's not possible. The table view owns its whole area, and renders cells based on it's internal logic.

    You could divide your table view into sections and add a custom cell as a section header or footer, or you could make your cellForRowAtIndexPath serve up a custom type of cell for every 4th row that ONLY contains your full-sized button. That should accomplish your goal.

    0 讨论(0)
提交回复
热议问题