Last active
October 27, 2020 18:25
-
-
Save tiagobbraga/422c9ba9d1274b5adb134fb09e311f68 to your computer and use it in GitHub Desktop.
UIScrollView Scrollable Content Size Ambiguity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xcode 11+ | |
The simplest way using autolayout: | |
1. Add UIScrollView and pin it 0,0,0,0 to superview (or your desired size) | |
2. Add UIView in ScrollView, pin it 0,0,0,0 to all 4 sides and center it horizontally and vertically. | |
3 .In size inspector, change bottom and align center Y priority to 250. (for horizontal scroll change trailing and align center X) | |
4. Add all views that you need into this view. Don't forget to set the bottom constraint on the lowest view. | |
5. Select the UIScrollView, select the size inspector and deselect Content Layout Guides. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment