TGLStackedViewController icon indicating copy to clipboard operation
TGLStackedViewController copied to clipboard

Make the bottom most card also visible in full length

Open annathomasQB opened this issue 10 years ago • 5 comments

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 avatar Nov 11 '15 05:11 annathomasQB

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.

annathomasQB avatar Nov 11 '15 05:11 annathomasQB

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

gleue avatar Nov 11 '15 08:11 gleue

@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 avatar Dec 23 '15 21:12 ghost

@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

ghost avatar Dec 23 '15 21:12 ghost

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 avatar Dec 26 '15 09:12 gleue