Currently, I have a layout design as following
[Safe Area]
[Scroll View (In green color)]
[Custom View (In red color)]
[Horizontal Stack View]
[Button 1]
[Button 2]
[Text View]
[Bottom Toolbar]
It is designed so that, as the content of [Text View]
grow, user can scroll vertically [Text View]
together with the buttons group ([Horizontal Stack View]
)
It suppose to look as the following
We think we have used the correct constraints, between [Custom View]
and [Scroll View]
Custom View.top = Content Layout Guide.top
Custom View.trailing = Content Layout Guide.trailing
Custom View.leading = Content Layout Guide.leading
Custom View.bottom = Content Layout Guide.bottom
Custom View.width = Frame Layout Guide.width
One warning we are getting from Xcode is
Scrollable content size is ambiguous for "Scroll View".
Hence, to avoid such, we need to add
Custom View.centerX = Frame Layout Guide.centerX
Custom View.centerY = Frame Layout Guide.centerY
However, when we execute the app, only [Text View]
is vertically scrollable, when the text content grows. The top buttons group remains static.
We try to disable scrolling behaviour in [Text View]
itself. Again, the entire page is not scrollable, when the text content grows.
Do you have any idea how to fix this, so that when text content grow, the top button group can scroll together with text view?
The demo is located at https://github.com/yccheok/ios-tutorial/tree/learn-scroll-view/NavigationController