How to reset the virtual scroll height in angular 14+ - angular-material

In angular, I've implemented virtual infinite scroll. The issue I'm having is that when I try to reset the data after scrolling, it resets, but the scroll bar still displays how far I scrolled.
View in Stack blitz
How to replicate:
When you click the link, data will load inside the viewport.
By repeatedly scrolling, the view port will be updated with fresh data.
notice the scroll bar after clicking the clear button.

Related

UITableView in ScrollView - how to change scroll handler?

I have a pretty weird setup due to time restrictions and UI requirements.
The layout is pretty simple: the root view is a ScrollView, with a StackView in it. StackView has two elements, a header (which I wish to collapse), and the content (which is a custom tab bar, and below that, a container view for the tab bar's linked content).
Latter is constrained in height to the ScrollView, resulting in a kind of "sticky header" (the tab bar's top sticks to the navigation bar's bottom) and "collapsing header" (the header view is "collapsed", as it is scrolled out of the view).
This works fine, however I can't seem to find any information regarding how to handle scroll events. What I want is a "single" scrollable view with the tab bar being sticky.
The end result would work like this:
User starts scrolling, ScrollView handles scrolling up until the moment it "bottoms out", then hands over scrolling to the UITableView currently visible. When the user starts scrolling up, the UITableView currently visible scrolls until it hits the top, and immediately hands over scrolling to the outer ScrollView, which will then scroll down the tab bar and reveal the header.
On Android it's quite simple to implement, due to the Toolbar component's extendibility, but on iOS I'm dead in the water how to implement this. I've tried looking up scroll handover, but haven't found anything related to my issue - possibly I've used the wrong search query, but not sure.
How could I hand over the scroll event the easiest way?

developing an infinite title slider with corresponding pageViewController

ok, I wanted to create these custom controls I've seen in this app:
DownTown App
an infinite title slider above and an infinite page view controller below. you can scroll title infinitely and after scrolling finished, corresponding page controller scrolls to target viewController in that direction.
and you can can scroll the view controller below, and above titleSlider also scrolls with that.
so I create these components but the result is not exactly what I want, because there were some challenges I couldn't solve them. here you can download the component:
http://github.com/hashemp206/HAInfinitePageController
the first problem is as as I scroll titles, the target cell rest at center of view. but as I scroll faster and more you see the title is not resting at center and I have to manually move that cell to the center with animation.
to clarify how this title slider scrolls infinitely, I have created a UICollectionView with 3 section. when scrollView reaches an offset limit, I will jump back to the middle section.
the second problem is when I scroll the below pageController slowly, the above title slider moves well and correctly, but when I scroll faster this synchronization gets corrupted, and the title slider scroll can't synchronize itself with below page controller.
so I'm asking you expert guys, can you see my developed component and guess why it is not working well?
or if you want to challenge yourself can you develop this component exactly?

UITableView Scroll animation

I'm trying to make a tableview witch scrolls automatically in very slow speed to the bottom and then goes back to the top and starts again in a loop. The user also have to be able to scroll independently , I tried with
tableView.scrollRectToVisible(CGRect(...)) with no luck, also tried with tableView.scrollToRowAtIndexPath(...)again with no luck.

Restricting the right scroll for scroll view at some conditions

I was working with scroll view with ten pages, user can scroll in both directions with gesture and button actions. But there are some situations in which a toggle button in view is on we need to stop right side scrolling up to user fills the data once he fills the data scrollview need to start scrolling again. one more situation is when toggle is on user need to skip all views and directly scroll to last view. I need to maintain page count on screen too.

How To Show Scrollbar Always On UICollectionView

I have a UICollectionView added to a UIView in an app I am working on. Displayed in the UICollectionView I have a set of images pulled from Core Data. The vertical scrolling works fine but the scrollbar does not display until the user touches the UICollectionView.
How can I make sure the scrollbar at the right is always visible so that an indication is given to the user that it is scrollable?
You can't make them always visible. Instead, you can flash them once, when the user is first presented with the collection view to notify them, that this view can be scrolled.
Since UICollectionView is a subclass of UIScrollView you can do this:
[myCollectionView flashScrollIndicators];
Check out the Settings app for instance. When you go to a settings list that is longer then the screen, the scroll indicator is flashed once.
FYI for Swift:
myCollectionView.flashScrollIndicators()

Resources