-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CollectionView in Row? #16
Comments
so i managed to get a collectionview to display by setting a height constraint but when i tap on the cells inside it the whole thing disappears. |
Hi @shokaveli, thanks for your interest in AloeStackView. Displaying a UICollectionView as a row in an AloeStackView is not supported out-of-the-box. One issue is that UICollectionView is also UIScrollView, just like AloeStackView is. Hence, adding one as a row will result in nested UIScrollViews that scroll in the same direction, which is something that is generally not supported by UIKit. Another issue is that UICollectionView does not self-size to its contents, so AloeStackView (which just uses UIStackView under the hood) will not know how to size the row. As you discovered, you can work around this by giving it a fixed height constraint, but this won’t be based on the content it’s displaying so you’ll likely run into problems making it the correct height you want across devices (not to mention other issues you’ll run into getting it to display correctly). In this case, you’re probably better off laying out the views inside the collection view manually inside their own view and adding that as a row, or not using AloeStackView and just using the collection view by itself. Let me know if I can answer any more questions specific to AloeStackView! |
Is this possible to do? I tried it and could not get the collectionview to display.
The text was updated successfully, but these errors were encountered: