gsdios / SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.
MIT License
5.9k stars 1.28k forks source link

cell中高度的自适应 #7

Open opencheer opened 8 years ago

opencheer commented 8 years ago

// >>>>>>>>>>>>>>>>>>>>> * cell自适应步骤2 * >>>>>>>>>>>>>>>>>>>>>>>> /* model 为模型实例, keyPath 为 model 的属性名,通过 kvc 统一赋值接口 */ return [self.tableView cellHeightForIndexPath:indexPath model:self.modelsArray[indexPath.row] keyPath:@"model"];

问下这里的keyPath具体的应用场景下应该写什么?

gsdios commented 8 years ago

此处 利用 kvc 给cell的数据模型属性赋值,keypath为model的属性名

liumin007 commented 8 years ago
gsdios commented 8 years ago

第一次计算高度;第二次正式的数据展示。

gsdios commented 8 years ago

SDAutoLayout的cell高度自适应完成进一步升级:一行代码(一步设置)搞定tableview的cell高度自适应,同时适用于单cell和多cell