diff options
-rwxr-xr-x | Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs index a566f24a..11195386 100755 --- a/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs @@ -123,7 +123,16 @@ namespace Xamarin.Forms.Platform.Tizen void ScrollRequestHandler(object sender, ScrollToRequestedEventArgs e) { - Rect region = new Rect(ToNativeDimension(e.ScrollX), ToNativeDimension(e.ScrollY), ToNativeDimension(Element.Width), ToNativeDimension(Element.Height)); + var x = e.ScrollX; + var y = e.ScrollY; + if (e.Mode == ScrollToMode.Element) + { + Point itemPosition = (Element as IScrollViewController).GetScrollPositionForElement(e.Element as VisualElement, e.Position); + x = itemPosition.X; + y = itemPosition.Y; + } + + Rect region = new Rect(ToNativeDimension(x), ToNativeDimension(y), ToNativeDimension(Element.Width), ToNativeDimension(Element.Height)); Control.ScrollTo(region, e.ShouldAnimate); } } |