Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

macOS Example project - Implement dynamic height for cells #85

Open
christoff-1992 opened this issue Jan 23, 2019 · 7 comments
Open

macOS Example project - Implement dynamic height for cells #85

christoff-1992 opened this issue Jan 23, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@christoff-1992
Copy link
Collaborator

Need to implement an example for dynamic height for the macOS Example, at the point of asking for the size in sizeForItemAt*, the collection view has not been loaded into the view so we can not make use of makeItem(withIdentifier*.

We will need to load a dummy cell and set the calculated width like the iOS example does.

@christoff-1992 christoff-1992 added the enhancement New feature or request label Jan 23, 2019
@zdnk
Copy link

zdnk commented May 28, 2019

is there iOS example? using autolayout in code would be the best :)

@zenangst
Copy link
Owner

Hey @zdnk, there is a demo project for iOS included in the library. Simply run the Blueprints.xcodeproject and select the example target :)

@zdnk
Copy link

zdnk commented May 29, 2019

From what I discovered, it is running the AutoLayout but getting the prototype cell, laying it out and caching its size. However doesnt iOS provide autosizing with AutoLayout by default without such implementation?

EDIT: it also seems that the performance is poor :(

@zenangst
Copy link
Owner

@zdnk Oh like that, I thought you were wondering about an example in general, my bad!
I'm a bit unsure, I've yet to implement a collection view layout with autolayout based constraints in order to figure out the item size. I think this is a bit of a chicken and eggs scenario because you don't know the size of the item at the time when prepare is invoked, I might be wrong here.

What performance is poor? Using autolayout of the demo project that we provide?

@zdnk
Copy link

zdnk commented May 29, 2019

I see. Well AutoLayout is way too slow anyway. I am considering usage of Texture, PinLayout or FlexLayout.

@zenangst
Copy link
Owner

@zdnk all good alternatives! Best of luck :)

@christoff-1992
Copy link
Collaborator Author

We may be able to do this with the preferred layout attributes, I will take a look once this has been merged into master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants