iOS cell自适应 自定义cell
- 自适应(self sizing cell)
- Subviews and auto layout.
// Must set the following properties
self.tableView.estimatedRowHeight = 85.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;
自定义cell
自定义cell 在drawRect中绘出子视图
using subviews
给子视图数据
- 尽量避免重复布局(在创建子视图时,只布局一次)、子视图不透明、子视图太复杂时(用drawRect画出子视图)
- Avoid relayout of content. When reusing cells with custom subviews, refrain from laying out those subviews each time the table view requests a cell. Lay out the subviews once, when the cell is created.