解决重写tableViewCell的初始化方法会导致cell的高度计算失效的BUG#266
Open
zhl5213 wants to merge 1 commit intogsdios:masterfrom
zhl5213:master
Open
解决重写tableViewCell的初始化方法会导致cell的高度计算失效的BUG#266zhl5213 wants to merge 1 commit intogsdios:masterfrom zhl5213:master
zhl5213 wants to merge 1 commit intogsdios:masterfrom
zhl5213:master
Conversation
在一个项目中,我重写一个tableViewCell类的-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier方法的时候,使用两个reuseIdentifier来给该cell类设置了两种不同的显示模式。结果cell高度计算全部失效。 经过分析,是因为SDAutoLayout实现高度计算的时候,内部注册cell默认统一使用的类的名字作为reuseIdentifier,然后导致我的类中使用reuseIdentifier来判断显示模式的方法全部没有调用。 因此,新增了几个接口,里面加入了reuseIdentifier判断, 如果使用自定义的reuseIdentifier在cell中进行了业务判断处理,使用新的接口就行了
|
晕,着了两天终于找到问题了,然后来Git告知,没想到这里已经解决。 使用SD时, 并且因为 使用了WMPageController ,三个item 中,前两个无问题,只有最后一个tableview 发生问题。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在一个项目中,我重写一个tableViewCell类的-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier方法的时候,使用两个reuseIdentifier来给该cell类设置了两种不同的显示模式。结果cell高度计算全部失效。
经过分析,是因为SDAutoLayout实现高度计算的时候,内部注册cell默认统一使用的类的名字作为reuseIdentifier,然后导致我的类中使用reuseIdentifier来判断显示模式的方法全部没有调用。
因此,新增了几个接口,里面加入了reuseIdentifier判断, 如果使用自定义的reuseIdentifier在cell中进行了业务判断处理,使用新的接口就行了