TLYShyNavBar
TLYShyNavBar copied to clipboard
Improved support for swapping scroll views.
Use Case: My Extension view contains a toggle that I use to switch between two content scroll views. Both scroll views should appear just below my extension view, however when I toggle between them (and assign the newly visible scroll view to the shy nav bar), the content insets of the new scroll view are not updated according to the height of the extension view.
In an attempt to fix this I have exposed the layoutViews method in my client code, so that I can invoke it when I swap the scrollViews, however the content inset of the new scroll view is not set because UIEdgeInsetsEqualToEdgeInsets(scrollInsets, self.previousScrollInsets) causes the method to return. Setting previousScrollInsets to UIEdgeInsetsZero prior to this seems to do it, however it feels like a hacky solution so would like to raise this so that a proper fix can be devised.
This is a delicate issue, since the component is doing its best to avoid unnecessary revalidation, but the user should be able to force it. We possibly need to add a public method invalidateContentOffset
or something similar, and call it if the scrollView is changed as well, if that is not currently the case.
Having the same issue. Any status on if/when this will be implemented?
@aasatt I honestly don't have immediate plans to work through this specific issue, but it's definitely important to fix some day.
Same issue