GithubHelp home page GithubHelp logo

Comments (15)

steipete avatar steipete commented on June 12, 2024

Yep, i want this too. Shouldn't be that hard (as compared to section headers)

from gmgridview.

gmoledina avatar gmoledina commented on June 12, 2024

Just one header for the entire grid (with the benefit of scrolling with the grid content) or header per section ?

from gmgridview.

aquarius avatar aquarius commented on June 12, 2024

I also needed support for a grid header view. I added it to my fork:
aquarius@65d43a8

from gmgridview.

gmoledina avatar gmoledina commented on June 12, 2024

It only seems to make sense for the Vertical Strategy. Looks weird for Horizontal strategies, specially the paged ones.

from gmgridview.

aquarius avatar aquarius commented on June 12, 2024

Right, you probably need to attach it to the grid view directly if you have paging enabled so it always stays on top.

How would you solve this? Add a BOOL to the layout strategy to indicate how the header/footer views are positioned (sticky or scrolling)?

from gmgridview.

steipete avatar steipete commented on June 12, 2024

I'm also very interested in the header view; we can add simple support for now and improve it with different layouts later.
Any opposition to that?

from gmgridview.

gmoledina avatar gmoledina commented on June 12, 2024

Sure no problem. I was thinking of a solution in the same direction as the layout strategy idea; as in giving the user control on how to position the header. So the core code doesn't has no logic about specifics headerView positioning behavior.

I like Markus's implementation of the headerview, that could be the headerViewContainer. And then the user can set any other view responding to a protocol with callbacks for when the scroll is scrolled for example, so the user can choose the reposition it's own headerView if needed.

The method to set the headerView could be setHeaderView:withSuggestedSize:
In the case of vertical layout, the headerView width will be that of the scroll frame and the height will be the above specified parameter. In the case of horizontal layout, the height will be that of the scroll frame and the width will be the above specified parameter.

What do you think? Is it overkill ?

from gmgridview.

kielgillard avatar kielgillard commented on June 12, 2024

I'm interested in the addition of this API, too.

from gmgridview.

nomadplanet avatar nomadplanet commented on June 12, 2024

+1 !

from gmgridview.

andrewtheis avatar andrewtheis commented on June 12, 2024

I'm adding a header for the whole Grid in interface builder, and using setMinEdgeInsets: to shift the grid content down. This would work great except cells are dequeued & removed from the view prematurely when scrolling up (about 1 grid row distance). Thoughts? Am I using setMinEdgeInsets incorrectly?

from gmgridview.

andrewtheis avatar andrewtheis commented on June 12, 2024

Figured this out: When calculating out the rows to display, the vertical layout strategy doesn't take into account the minEdgeInsets. I changed line 225 in GMGridViewLayoutStrategies to:

CGFloat firstRow = MAX(0, (int)((contentOffset.y - self.edgeInsets.top) / itemHeight) - 1);

from gmgridview.

kylefox avatar kylefox commented on June 12, 2024

+1

Any updates on this? Would really love to (easily) add a header view in vertical mode.

from gmgridview.

m2d2 avatar m2d2 commented on June 12, 2024

andrewtheis, fantastic catch on the layout strategy. aquarius branch + your fix made everything work :)

from gmgridview.

bencallis avatar bencallis commented on June 12, 2024

Did anyone ever implement this? I was hopping to included a searchbar at the top of the grdiview. So when you pull down it appears (like in mail).

from gmgridview.

neoneye avatar neoneye commented on June 12, 2024

+1

I'm interested in this too.

from gmgridview.

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.