TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

[ASPagerNode] Cell node layout not resizing after rotation #1753

Open mohitnandwani opened 4 years ago

mohitnandwani commented 4 years ago

New to texture and using Texture version 2.8.1. I tried adding Page layout to my project. The portrait layout works completely fine but whenever I rotate my device cell's layout don't resize according to node's bounds. I'm attaching screenshots and a sample project. By now, I've tried adjusting the scroll inset and transitioning layout on viewWillTransition but had no luck. Let me know if a solution for this exist.

Portrait Mode: Portrait

Landscape Mode: Landscape

Example Project: PagerNodeRoationIssue.zip

foxware00 commented 4 years ago

I'm facing similar but subtly different issues with measuring pager node during rotation.

Are there any known issues/workarounds @nguyenhuy?

foxware00 commented 4 years ago

@mohitnandwani Did you get anywhere with layout issues? I'm getting closer, but safeAreaInsets are being incorrectly reported the first time I draw a lot of views in landscape

mohitnandwani commented 4 years ago

@mohitnandwani Did you get anywhere with layout issues? I'm getting closer, but safeAreaInsets are being incorrectly reported the first time I draw a lot of views in landscape

Nope. Still having issues with resizing. How's your progress? Can you share an example code base of yours @foxware00?

mohitnandwani commented 4 years ago

@foxware00 One observation I've had is that if i reload the cells, then only layout updates.

foxware00 commented 4 years ago

@mohitnandwani I've settled on consuming the safe areas before laying out the pager and insetting the whole view and then making the view controllers (each page of the pager) ignore safe areas as this is where Texture has a bug. I haven't been able to work out why yet. As for resizing I just call relayoutItems when viewWillTransition is called on the parent view controller. Thus they they seem to size correctly. It's just the safe areas that have the issue