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

swift4.2.1 cellheight #303

Open beydeng opened 5 years ago

beydeng commented 5 years ago

Swift 使用cellheight的时候,因为set - value 的改变,导致cellheight方法找不到model而崩溃,想请教下,如何解决?添加了@objc和@objcMembers 还是异常。

tangzhifengjluzh commented 5 years ago

我也是。你解决了么。

xiaoojun commented 5 years ago

同样的 期待作者回复。😀

DemoFucker commented 5 years ago

已解决:在用到的model和cell类上添加@objcMembers即可解决。

AllenYL commented 5 years ago

你能自适应cell高度了?我的就是全部重叠到一起了,使用方法和约束都如同oc,但是swift版本就是会出错 @DemoFucker

DemoFucker commented 5 years ago

@AllenYL 可以了,你加我QQ吧,1328441212

xiaoojun commented 5 years ago

let H = Int(self.cellHeight(for: indexPath, cellContentViewWidth: screenWidth, tableView: tableView))

return CGFloat(H) 返回高度使用这种方式

------------------ 原始邮件 ------------------ 发件人: "AllenYL"notifications@github.com; 发送时间: 2019年7月30日(星期二) 下午3:33 收件人: "gsdios/SDAutoLayout"SDAutoLayout@noreply.github.com; 抄送: "秋天渔夫"961721716@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [gsdios/SDAutoLayout] swift4.2.1 cellheight (#303)

你能自适应cell高度了?我的就是全部重叠到一起了,使用方法和约束都如同oc,但是swift版本就是会出错 @DemoFucker

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

DemoFucker commented 5 years ago

@xiaoojun 本质上还是swfit调用OC的方法问题,在需要的model或者类里添加@objcMembers就可以

AllenYL commented 5 years ago

@xiaoojun 谢谢,已经解决了