Open opencheer opened 8 years ago
// >>>>>>>>>>>>>>>>>>>>> * cell自适应步骤2 * >>>>>>>>>>>>>>>>>>>>>>>> /* model 为模型实例, keyPath 为 model 的属性名,通过 kvc 统一赋值接口 */ return [self.tableView cellHeightForIndexPath:indexPath model:self.modelsArray[indexPath.row] keyPath:@"model"];
问下这里的keyPath具体的应用场景下应该写什么?
此处 利用 kvc 给cell的数据模型属性赋值,keypath为model的属性名
第一次计算高度;第二次正式的数据展示。
SDAutoLayout的cell高度自适应完成进一步升级:一行代码(一步设置)搞定tableview的cell高度自适应,同时适用于单cell和多cell
// >>>>>>>>>>>>>>>>>>>>> * cell自适应步骤2 * >>>>>>>>>>>>>>>>>>>>>>>> /* model 为模型实例, keyPath 为 model 的属性名,通过 kvc 统一赋值接口 */ return [self.tableView cellHeightForIndexPath:indexPath model:self.modelsArray[indexPath.row] keyPath:@"model"];
问下这里的keyPath具体的应用场景下应该写什么?