- Align the top, bottom, left, and right of the UIScrollView with the View of the UIViewController
As the name implies, the Content Layout Guide shows the contents of the UIScrollView, and the Frame Layout Guide shows the frame area of the UIScrollView. https://qiita.com/owen/items/2fab4a4482834b95e349
I think it's the theory to surround it with UIView, but Apple is a little unfriendly ...
When I put the restrictions on the top, bottom, left, and right of the Content Layout Guide on the ContentView, even if I stretch it to fill the screen and pull the constraint with Ctrl, there is a gap between +315 and +812 for some reason. It's hard to notice by appearance, but be careful as it won't scroll unless you fix it to 0.
If you do not add a constraint with ContentView.bottom to the bottom element of the content inside, the height will not be fixed and you will get angry.
With the correct setting, the lower side may become empty when there are few elements inside. If you match the Bottom of the ContentView to the Frame to fill it, the Frame seems to be the visible part of the top, bottom, left, and right of the iPhone, and the Bottom of the ContentView that should extend further down stops at the bottom of the iPhone and does not scroll (transmitted). When the contents are small and the bottom is empty, is there no choice but to match the background colors of ContentView and ScrollView to make it look like it is not empty?
Recommended Posts