Git Product home page Git Product logo

Comments (2)

shokaveli avatar shokaveli commented on June 20, 2024

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.

from aloestackview.

marlimox avatar marlimox commented on June 20, 2024

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!

from aloestackview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.