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

在iPad上屏幕旋转后界面约束失效 #52

Closed
beiguancyc opened this issue Dec 16, 2021 · 3 comments
Closed

在iPad上屏幕旋转后界面约束失效 #52

beiguancyc opened this issue Dec 16, 2021 · 3 comments

Comments

@beiguancyc
Copy link

beiguancyc commented Dec 16, 2021

用demo跑在ipad ios 15上,屏幕旋转后界面布局失效
临时解决办法

override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        collectionViewLabel?.reloadData()
    }

希望能解决

@czl0325
Copy link
Owner

czl0325 commented Dec 20, 2021

reloadData前面加上这句话

[(ZLCollectionViewVerticalLayout*)self.collectionViewLabel.collectionViewLayout forceSetIsNeedReCalculateAllLayout:YES];

@beiguancyc
Copy link
Author

�是否有办法可以修改库的源代码,而调用方不用在加这些代码呢?
希望得到您的指教

@czl0325
Copy link
Owner

czl0325 commented Dec 21, 2021

这个方法就是开放出来让你在需要重排的时候调用的。什么时候需要重排由使用者来决定。不是库里面写死的,也有可能有人需求旋转屏幕的时候不重排呢?

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