SDAutoLayout icon indicating copy to clipboard operation
SDAutoLayout copied to clipboard

swift4.2.1 cellheight

Open beydeng opened this issue 6 years ago • 9 comments

beydeng avatar Dec 06 '18 11:12 beydeng

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

beydeng avatar Dec 07 '18 01:12 beydeng

我也是。你解决了么。

tangzhifengjluzh avatar Dec 11 '18 10:12 tangzhifengjluzh

同样的 期待作者回复。😀

xiaoojun avatar Jan 04 '19 01:01 xiaoojun

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

DemoFucker avatar May 23 '19 08:05 DemoFucker

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

AllenYL avatar Jul 30 '19 07:07 AllenYL

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

DemoFucker avatar Jul 30 '19 07:07 DemoFucker

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

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

------------------ 原始邮件 ------------------ 发件人: "AllenYL"[email protected]; 发送时间: 2019年7月30日(星期二) 下午3:33 收件人: "gsdios/SDAutoLayout"[email protected]; 抄送: "秋天渔夫"[email protected]; "Comment"[email protected]; 主题: 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.

xiaoojun avatar Jul 30 '19 07:07 xiaoojun

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

DemoFucker avatar Jul 30 '19 07:07 DemoFucker

@xiaoojun 谢谢,已经解决了

AllenYL avatar Jul 30 '19 08:07 AllenYL