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

通过storyboard创建后的布局问题 #6

Open
R-U-N opened this issue Jul 2, 2018 · 6 comments
Open

通过storyboard创建后的布局问题 #6

R-U-N opened this issue Jul 2, 2018 · 6 comments

Comments

@R-U-N
Copy link

R-U-N commented Jul 2, 2018

使用storyboard创建后,在不同的屏幕尺寸上运行,WRCycleScrollView无法自动适配,只会显示storyboard上的默认大小

@kodeflow
Copy link

我把这里改成一致的就好了
image

@R-U-N
Copy link
Author

R-U-N commented Jul 30, 2018

@1149863953 但是你一旦运行其他屏幕尺寸,依然会有问题。这里改成一致只能解决对应的机型运行的适配问题

@kodeflow
Copy link

我分别用iphoneX和iphone 6 plus测试正常

@kodeflow
Copy link

img_1401
b314442cf5658f3fd0ca65e87f9e6754

@R-U-N
Copy link
Author

R-U-N commented Jul 31, 2018

@1149863953 你再用iphoneSE问题会更明显一点。在xib中的屏幕选项只是默认的xib尺寸,在viewDidLoad之后会根据设备的真实尺寸再更新frame,再看作者的源码,只是简单将superview的bounds复制给collectionView ,因此,当superview的尺寸,也就是xib中绑定的view发生变化时,collectinView还是保存着旧的frame,导致布局出错。 建议作者@wangrui460 在viewDidLayoutSubview中更新布局。
2018-07-31 2 11 21

@kodeflow
Copy link

你可以提交给作者

kodeflow added a commit to kodeflow/WRCycleScrollView that referenced this issue Jul 31, 2018
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