Android - YogaLayout not working inside ScrollView #435
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
Expected Behavior
YogaLayout inside ScrollView should be visible event I set width.
Actual Behavior
When you set width to ScrollView node, the content becomes invisible. I checked with Hierarchy Viewer the content has 0 height and 0 width.
Link to Code
Thanks for the report! Most likely need to set overflow:scroll on the scrollview node. Possibly a bug in the bindings. Maybe the bindings could even do this on behalf of the user by detecting if it is a scroll container.
When you use native container inside YogaLayout, you will face this issue probably. For example I tried SearchView too. It has LinearLayout inside. The content inside LinearLayout not calculated and has 0 height width. I checked them with Hierarchy Viewer.
This might also be a (lack of) invalidation error. That is, the root node is measured at size 0,0 and never remeasured. Are you ever calling
invalidateView
?Does someone resolve this problem?
We're deprecating the
com.facebook.yoga.android.YogaLayout
ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.