Open
Conversation
Owner
|
谢谢大兄弟的提醒和修改。之前针对这个问题也简单修改了cell的_separatorColor为_separatorLineColor,也一直忘记来更新。我的理解是,当同名方法出现是,代码执行的顺序是分类 > 本类 > 父类。所以分类中的setSeparatorColor方法会覆盖住YCMenuCell中的setSeparatorColor。 |
Author
是的,认同你说的 分类 > 本类 > 父类,UIKit控件UITableViewCell 的setSeparatorColor方法被重写但是没有调用,就很奇怪 |
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.
感谢作者分享,这个库使用很简单、方便!
修复菜单项之间分割线颜色失效问题;
猜想:父类UITableViewCell原始方法setSeparatorColor:是以Catogory的方式实现,在编译完成后由于各种原因(查阅中,后续更新),YCMenuCell中setSeparatorColor:方法被UITableViewCell覆盖;
验证:通过runtime,查看系统控件UITableViewCell的方法列表已经包含了YCMenuCell下的setSeparatorColor:方法
最后通过修改YCMenuCell下的setSeparatorColor:方法名称为setMenueSeparatorColor:修复;