Getting ListView scroll position - nativescript

Is possible to get ListView Y scroll position?
I can't find any info about listview scroll positions. in docs. I just found that I can get position only in ScrollView by:
scrollView.scrollToVerticalOffset

Related

Get the Maximum and current value of Scrollbar in Listview

As the title say:
I want to know values of a scrollbar in the ListView such as:
Minimum value I know = 0 :)
Maximum value of a scrollbar
Current value (position of a bar inside of a scrollbar)
Is this possible?
How to make it work for both iOS and Android?
I have tried with ItemAppear to get the position in the ListView but all I can get is the position of an item not the actual scrollbar position and with ItemAppear the problem is if I have big images in the list then I scroll 1 mile but nothing happens until the other item appears.
ListView doesn't fire Scrolled events like ScrollView does.
If you still want to get current value or maximum value of scrollbar, I suggest you can render new Listview, that contains scrolled event. or you can search some third party control, may be have this event.

How to stop listview from scrolling to default when re binding the item

I have a ListView loaded with items.
When I update the model and try to re-bind the ItemsSource the ListView scrolls to the default position.
I there a way to prevent the ListView from scrolling when re-binding the data or scroll to the previous position.
I am using ObservableCollection for the list.

iOS11 paged scroll view suddenly is scrollable vertically

I have an app which uses EMPageViewController to display a set of onboarding slides. My understanding is that the underlying scroll view is using paged mode to display slides.
Upon update to iOS11, I see that suddenly the slides follow the finger, so they are draggable and bounce up and down. I expect paged scroll view to be scrollable horizontally only.
How can I restrict paged scroll view to horizontal scrolling only in iOS11 ?
I tried this but it did not work
pageViewController.scrollView.alwaysBounceVertical = false
This fixes the issue:
if #available(iOS 11.0, *)
{
self.scrollView.contentInsetAdjustmentBehavior = .never
}
The behavior for determining the adjusted content offsets. This
property specifies how the safe area insets are used to modify the
content area of the scroll view.
contentInsetAdjustmentBehavior is new from iOS 11 > and the default value is automatic.
Content is always adjusted vertically when the scroll view is the
content view of a view controller that is currently displayed by a
navigation or tab bar controller. If the scroll view is horizontally
scrollable, the horizontal content offset is also adjusted when there
are nonzero safe area insets.
Which made some of my UIScrollView scroll more than they were excepted to.

How to sync two scrollviews in react native?

My requirement is to create a table with fixed header and first column, table data will scroll in both horizontal and vertical directions.
for this I have used 3 scrollviews , following gif will make it clear
1st scrollview is the header name row, it is set to horizontal = true (i.e its scroll direction is horizontal)
2nd scrollview is kcname 1st column of the table, it is vertical scroll, both of these have scrollEnabled={false}, as they wont take scroll gesture, they are scroll programmatically using scrollTo
3rd scrollview is body cell table filled with data, this view has 2 scrollviews as parent , one to take horizontal scroll and another to take vertical scroll.
the scroll values of two body scroll views are put in scrollTo of the other two scrollview using refs on onScroll event, scrollEventThrottle value is 16 .
My problem is how to sync these scrollviews scrolls as this clearly shows lag, which is not acceptable
Disable scrollTos animation like this:
this.toolbar.scrollTo({
x: yourXValue,
animated: false,
});
Then there is no lag :)

trouble in scrolling in uitableview

I've created a Tableview populated with cells with a fixed tableView.rowHeight = 95.0
The problem is that when I add more cells and I try to scroll to the bottom, I can see only half cell at the bottom. I mean, when I try to scroll I can't scroll down so that to see the entire last cell added.
Seems the scrolling bar doesn't work well. Is this a bug of Xcode or did I make something wrong?
I don't want a resizable height cell but I want my cell fixed with with 95.0 but at the same time I want my scrollbar to work better.
The problem is if the table height exceeds the your mainview. At that time srollview of tableview also goes down.solution is keep the tableview height within the bounds of mainview(i.e your viewcontroller's view)

Resources