I'm constructing a nestedlistview(horizontal listviews inside a sliverlist)inside my app.while scrolling the vertical sliverlist,the horizantal listviews going back to their starting position if i scroll past them,is there a way to maintain the offset for every horizontal listview
i have given a key and scroll controller to every horizontal listview and set the property keepscrolloffset true but that didn't work.
Related
I currently have a table view populated with a series of posts. What I am trying to achieve is to manipulate the table view scroll so that there is always one table view cell centred in the table view. I'd also like this to have some form of scroll snap, similar to a vertical carousel in which the centred / focused cell has a maximum alpha and original size, and the cells visible above and below are smaller and have a lower alpha. I have attempted using scroll target offset but with no luck. I am mainly struggling with the mathematics of the function.
The image below demonstrates what I am trying to achieve.
What I am looking for at the very least is a push in the right direction in regards to how I can manipulate the table view scroll to have this type of carousel function.
EDIT: Is it possible to achieve this with Paging in the Table View?
To elaborate on my question, I've three scrollviews one top of another, let say base, middle and top. Base scroll view's content size is more so it will scroll, middle scrollview's content size is equal to its frame so it will not scroll, top scrollview's content size is more than its frame so it will also scroll.
Now when I scroll the top scrollview, once it reaches its end, I"m expecting it would scroll the base scroll view as middle is not scrollable. But it seems middle scroll view consumes all my scroll events and not letting the scroll event to go to base scroll view.
I"ve tried by setting more content size to middle scrollview, then it working as expected, first top scroll view scrolls fully then it passes the scroll event to middle scroll view then to the base scroll view.
Now it is more evident that middle scrollview (which is non scrollable) is consuming all of my scrolling event from going to base scroll view. How do I prevent that.
Note : As I've to support zooming, I need scroll view in all three levels.
Any help would be really appreciated.
Thanks.
The UICollectionView disables scrolling by default when there is not enough cells in the view. When this occurs I need it to bounce back to position when pulled. Im am aware of a hack where I can fill the UICollectionView with empty tables to enable scrolling but I was hoping there would be a slightly more fluid example as
I don't want the view to scroll but instead to automatically bounce back to its position. This is because of the effect I have implemented below as can see below.
https://youtu.be/r75xB9-Mb4g
Is there a way to achieve this simply, when there is not enough cells in the UICollectionView the scroll is disabled.
For vertical scrolling:
self.collectionView.alwaysBounceVertical = true;
For horizontal scrolling:
self.collectionView.alwaysBounceHorizontal = true;
I have a UITableView at the bottom of the screen that pulls up and then snaps back down. When it is pulled up, though, you can see the view behind it because the tableview's height is finite and less than the size of the screen.
I tried using a large footer, but that affects the snap-back of scrolling the table up.
I also tried setting a fixed height for heightForFooter and returning a large view from viewForFooterInSection, but that view gets cut off after it reaches the height returned by heightForFooter
How can I display fixed content beneath my table without affecting its scrolling?
Add a background view to your table view, and then add a subview to that view with the color you need. You can position the subview around table/section headers.
In viewDidScroll, update the y position and height of the subview.
I thought about the possibilities in UI Design for a new app. What I want to do is:
Have three view where the user can paginate horizontally. In each of this view there is a UIScrollView (fills the whole view) where the user can scroll vertically.
How could I manage, that horizontal scroll events are managed by the Pagination and vertical scrolls are managed by the ScrollView?
I'm sorry, maybe this is kind of a "beginner-Question"...
There might be a possibility to send the different touches to different UI-Elements?
Place the 3 scroll views inside a large scroll view.
The 3 vertical scrolling views should have a content size that matches the screen's width - this will stop them scrolling horizontally and the event will pass up to the the parent scroll view to allow horizontal scrolling.
Ensure that the content size of the parent view matches the screen height so that it only scrolls horizontally.