Hi, there is a small problem with auto layout. I have a lot of UI elements on one line that fit on the screen (any, any). I need the UI elements that do not fit on the screen to move down. Can I do this with auto layout? UI elements have a fixed width and height.
3 answers
You can try to add a UICollectionView to the screen and add all the elements to it. Then that will not fit on the second line, the third and so on.
|
For such things use sayclasses
|
There are at least 2 solutions:
- UIStackView (if target iOS9 +) or OAStackView for earlier versions, for example
- UICollectionView with a properly configured layout (either pick the parameters in the flow layout, or make your subclass)
Pure autolayout can not do here for sure.
|