Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Make the bottom most card also visible in full length #28

Open
annathomasQB opened this issue Nov 11, 2015 · 5 comments
Open

Make the bottom most card also visible in full length #28

annathomasQB opened this issue Nov 11, 2015 · 5 comments
Labels

Comments

@annathomasQB
Copy link

Hi @gleue,

I want one more help again :)

Currently when you have many stacked cells, if you scroll down to the bottom, you can only see a part of the bottom most card.. if you try scrolling to the limit, you can see a part of it..

is it possible to see the last card in full? i hope you get my point..

@annathomasQB
Copy link
Author

This is what i intend for :
I need to use scrollToItemAtIndexPath to point to a cell, according to the date of the cell.. but this is not possible if the cell i need to point to is somewhere in the bottom of the list of cells.

@gleue
Copy link
Owner

gleue commented Nov 11, 2015

Did you try increasing the content size in TGLStackedLayout -collectionViewContentSize?

@ghost
Copy link

ghost commented Dec 23, 2015

@gleue I too have this issue. I tried fixing per your suggestion but no luck. Do you have any other suggestions?

Code:

    if let height = stackedLayout.collectionView?.contentSize.height {
        stackedLayout.collectionView?.contentSize.height = height + 500.0
    }

@ghost
Copy link

ghost commented Dec 23, 2015

@gleue / @annathomasQB This actually fixed the issue for me and shows the bottom card in its correct "unexposed" size just like the rest of the cards.
Although this won't show the bottom card in "exposed" (i.e. full) view per your original request.

edgesForExtendedLayout = UIRectEdge.None

@gleue
Copy link
Owner

gleue commented Dec 26, 2015

Try setting property TGLStackedLayout -itemSize to something != CGSizeZero and add the following lines to method TGLStackedLayout -collectionViewContentSize just below the CGSize contentSize = ... definition instead of manipulating the collection view's content size directly:

if (self.itemSize.height > self.topReveal) {
    contentSize.height += self.itemSize.height - self.topReveal;
}

This will show the last item in full size when stacked. If you want the same size for the exposed layout, just set TGLStackedViewController -exposedItemSize to the same value as above.

You may also want to set TGLStackedViewController -exposedPinningMode depending on your itemSize.

@gleue gleue added the question label Oct 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants