Yoga not working with UIScrollView #737
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Report
Issues and Steps to Reproduce
Expected Behavior
scrollview can scroll with right contentsize
Actual Behavior
can't scroll as well as right subview size.
x7f95e107d400; frame = (0 0; 414 736); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x6000002510a0>; layer = <CALayer: 0x6000000318c0>; contentOffset: {0, -64}; contentSize: {0, 0}; adjustedContentInset: {64, 0, 0, 0}>
Link to Code
Better after applyLayout() set contentSize property of UIScrollview to Scrollable size.
That's obviously a workaround.
But according to the tests it should work, but maybe the tests do not cover all cases..
Set height: auto for inner view before call layoutIfNeeded. Why?
Ok when UIScrollView will layout innerView it will set it's YogaNode height from auto to exact value, so the innerView will layout second time with exact height and all it's children will be placed inside rect with that height.
Workaround:
@xrom888 Would you mind giving more detail about the layout process in yoga, What is code in yoga imply " UIScrollView will layout innerView it will set it's YogaNode height from auto to exact value, so the innerView will layout second time with exact height and all it's children will be placed inside rect with that height."
@koenpunt I found it was a C# test case , didn't work on swift
We are deprecating YogaKit as part of the Yoga 2.0 release. We are still going to release a new revision based on the current state of the repo, but won't be accepting new contributions, since we are going to be removing it from the repo after.