Dynamic row heights of a UITableView inside a UITableViewCell

前端 未结 2 525
执念已碎
执念已碎 2021-01-19 03:57

I have a \'master\' UITableView, in which I use different cells that are loaded from .xib\'s. Some of these cells themselves also have a UITableView.

For now I have

2条回答
  •  心在旅途
    2021-01-19 04:40

    You could create the object which will create template object of class you want to put in cell, put data in it, calculate its size and return it on sizeForItem method of master tableView. That way you will be able to set returned calculated size for item when master tableView is preparing data.
    This is the way i do it in my projects.
    You could improve this object with cache, make it generic and use everywhere you may need to.

提交回复
热议问题