Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QMUIKit中的QMUIButton 使用MyLayoutSize.wrap无法自适应 #146

Open
captain-black opened this issue Oct 11, 2021 · 1 comment
Open

Comments

@captain-black
Copy link

使用了QMUIKit中的QMUIButton,但无法自适应宽高,以前我用masonry做约束是没问题的,能自动适应

@youngsoft
Copy link
Owner

您好,我去查看了一下QMUIButton的实现,发现是这个类重写了sizeThatFits这个系统方法。而布局的.wrap属性则是通过调用sizeThatFits方法来得到自适应尺寸的。因此可以得出QMUIButton重写的sizeThatFits是有BUG的。而至于autolayout设置约束没有问题的原因是autolayout进行自适应计算时并不是调用的sizeThatFits来实现尺寸自适应的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants