ScrollView scrollToVerticalOffset don't work on Android
See original GitHub issueI want to include a scrollToId() method in my ts.
fiche.html :
<ScrollView id="myScroller">
<FlexboxLayout (tap)="scrollToId('google-map')">
.....
</FlexboxLayout>
<FlexboxLayout (tap)="scrollToId('horaire')">
....
</FlexboxLayout>
<StackLayout id="horaire">
....
</StackLayout>
<GridLayout id="google-map">
...
</GridLayout>
</ScrollView>
fiche.ts :
public scrollToId(id: string) {
if (this.scrollLayout == null) {
this.scrollLayout = this.page.getViewById("myScroller");
}
let focus = this.page.getViewById(id);
this.scrollLayout.scrollToVerticalOffset(focus.verticalOffset, false);
}
All is ok on IOS but on Android, no scroll to StackLayout or GridLayout.
Any help on this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
ScrollToVerticalOffset() doesn't work? - Stack Overflow
Mine is started work after; ScrollViewer.UpdateLayout(); ScrollViewer.ScrollToVerticalOffset(outPoint.Y);.
Read more >ScrollViewer ScrollToVerticalOffset not working properly with ...
Hello,. I'm having troubles trying to dynamically scroll down TextControls (TextBox, TextBlock, RichTextBox) accordingly to their content.
Read more >WPF scrollviewer with Inertia - CodeProject
You can use ScrollViewer.ScrollToVerticalOffset to control the vertical scrolling of the ScrollViewer , as well as horizontally.
Read more >ScrollView - Android Developers
The scrollbar style to display the scrollbars at the edge of the view, increasing the ... insets that don't change when system bars...
Read more >[Solved]-scroll viewer text block scrolling in WP7-C#
In the code-behind, I added a DependencyProperty (which we can animate from outside) that calls the ScrollToVerticalOffset() method of our ScrollViewer at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Neferteus neither StackLayout nor GridKLayout have verticalOffset property. However you can use methods like getLocationRelativeTo or getLocationOnScreen / getLocationOnWindow or even getMeasuredHeight to calculate and scroll to the desired position.
e.g. page.component.html
page.component.ts
Thank you @mster 😃 . I will try as you said and let you know about it. Thank you.