-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Multiple Sections, Different Scroll Directions and Sticky Headers #304
Comments
Ya it will. This is one of the limitations of the supplied grid layout for sure. We have a custom layout internally for IG that handles grid and full-screen units. Honestly I'd like to refactor the grid layout a bit so it can do this and use it internally. That way we have the highest-quality layout that gets the same testing and attention as the rest of IGListKit. Another option is to use There are drawbacks to doing this though (e.g. if an item in the middle of the grid is removed...) but it might save you from making a custom layout that supports sticky headers.
Not impossible, but sometimes tricky. In a custom layout just return This layout might give you a place to start if you're going the custom layout route.
If you use supplementary views w/ the section controllers, just make sure to return an empty objects array in the adapter data source and you're set. The supplementary views will be removed. |
😵 This is super interesting. I'm interested to see how this works so I'll demo it out.
Easy enough, I thought it would be yet another struggle😅 Thanks @rnystrom |
In my case, to make sticky section header with IGListKit, use how about use |
@cruisediary Interesting I came across that library earlier this week. Good to know someone else though along the same line. I haven't tried implementing it though but since you succeeded i will. |
I have very similar layout in my app (Atsight), except for sticky headers. I am going to describe what I did, and I leave it up to the judgement of the community, because I am curious about better ways of doing it too! Just as a heads up, here is what it looks like in UI Hierarchy Viewer: I've implemented section titles as simple
Let me know what you think, and as I said, this approach works for me, so if there are any more questions I could help with, I am glad to share an information. |
Is this good to close? |
@jessesquires I'll post the method I used either today or tomorrow but for most part yeah it can close. |
@otymartin did you ever attempt to use |
@waltermvp there is a new layout coming soon which support sticky header. See #450 |
@waltermvp Oh man I forget to update myself on this. What I did was use a The top is a horizontalFlowLayout so thats cool As for that perfect grid, I had issues with "IGListGridCollectionViewLayout" which I mention in #140 so Instead I followed @rnystrom advice in #341 where rather than return 1 in my @rnystrom ... Take a look at my weather app data source as an example. Anytime something changes I recreate the models which power my different section controllers.` @zhubofei that looks super promising 👍 sweet :) |
@zhubofei thanks for the update @otymartin thanks for the workaround it's good to have something to use in the meantime |
@cruisediary do you have an example project using CSStickyHeaderLayout in conjunction with IGListKit? |
@otymartin can you please share the actual project with same scenario ? As i'm facing some trouble with same structure layout . This design i'm trying to make where the upper part is horizental scrolling and down part is vertical scroll but with condition that when i drag up the down collection View then the upper collectionView should hide . |
This is a Question/Discussion.
At hand, I'm trying to implement this layout using IGListKit. So the purpose of this issue/question/discussion is more to curate information on how this can be achieved with the current capabilities of this library. Hope it helps everyone.
I'm selflessly and selfishly providing the layout I'm attempting
(struggling)
to implement as a framework. Its similar to Instagram's current layout except Instagram got rid of the sticky headers, sad!PROBLEMS
1. How to create the Horizontal and Vertical scroll sections within the same CollectionView
According to @rnystrom && @bonzoq in #66, Their method is to create an
IGListCollectionView
with Vertical Flow Layout and imbed aCollectionView
with a Horizontal Flow in the first cell of theIGListCollectionView
. Then I guess the Vertical Scroll requires aCustomFlowLayout
to achieve the Grid?? (@zhubofei #225). More suggestions are welcome. Im attempting this now.2. How to create sticky headers for both sections
The Supplementary views example provides an example of how to achieve Section Headers but in order to get the
Sticky
effect, it requires you to doUICollectionViewFlowLayout().sectionHeadersPinToVisibleBounds = true
for iOS9+. I'm not sure this is available forCustomFlowLayout's
. How can this be done for custom layouts?3. How to hide the Horizontal or Vertical section in case of no data?
UITableView
provides this behaviour for free where a section along with its header are hidden if there is no data in it. How can this be done in this framework?Thanks🙌
New issue checklist
README
and documentationGeneral information
IGListKit
version: LatestThe text was updated successfully, but these errors were encountered: