Code Monkey home page Code Monkey logo

Comments (11)

pitiphong-p avatar pitiphong-p commented on September 15, 2024

Yes, you can. By having a custom subclass for the Header view for each section

from collectionviewshelflayout.

cukingpro avatar cukingpro commented on September 15, 2024

But the header is on top. Can I put it to the right like this?
Screen Shot 2019-08-07 at 3 12 09 PM

from collectionviewshelflayout.

pitiphong-p avatar pitiphong-p commented on September 15, 2024

What are those square? Are they a UICollectionViewCell?

from collectionviewshelflayout.

cukingpro avatar cukingpro commented on September 15, 2024

Yes. Those are cells of that section.

from collectionviewshelflayout.

pitiphong-p avatar pitiphong-p commented on September 15, 2024

I think in this case, you can have a disclosure indicator a UICollectionViewCell with another cell type with its own cell identifier and return it from the cellForItem method.

from collectionviewshelflayout.

cukingpro avatar cukingpro commented on September 15, 2024

That will make it scrollable. I want it to stay at the right.

from collectionviewshelflayout.

cukingpro avatar cukingpro commented on September 15, 2024

Screen Shot 2019-08-07 at 3 28 12 PM

This is the design.

from collectionviewshelflayout.

pitiphong-p avatar pitiphong-p commented on September 15, 2024

I see. I'm afraid that this library doesn't support this scenario out of the box but you can fork this project and make a change to make it support your scenario

from collectionviewshelflayout.

cukingpro avatar cukingpro commented on September 15, 2024

Thank you for your work. Do you have any suggestion for that?

from collectionviewshelflayout.

pitiphong-p avatar pitiphong-p commented on September 15, 2024

You can add a new kind of supplementary view for the detail disclosure (and may also with a custom Layout Attribute) and layout it in prepareLayout method similar to https://github.com/pitiphong-p/CollectionViewShelfLayout/blob/master/CollectionViewShelfLayout/CollectionViewShelfLayout.swift#L178-L186 and also return in the layoutAttributesForElements(in:) and layoutAttributesForSupplementaryView(ofKind:at:) methods

from collectionviewshelflayout.

pitiphong-p avatar pitiphong-p commented on September 15, 2024

Or if you set the deployment target at iOS 13 then you may try the new https://developer.apple.com/documentation/uikit/uicollectionviewcompositionallayout as presented in https://developer.apple.com/videos/play/wwdc2019/215/

from collectionviewshelflayout.

Related Issues (12)

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.