summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers
diff options
context:
space:
mode:
authorjh5.cho <jh5.cho@samsung.com>2016-12-26 17:06:19 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 11:11:14 +0900
commit3a88d09d149ae5472c3c64de95110414c2532687 (patch)
treec7c9598396a8fb05087f556bdf68be72984abe7b /Xamarin.Forms.Platform.Tizen/Renderers
parent30dbfc39db91f915ee120eddbd7e938e2804c1b7 (diff)
downloadxamarin-forms-3a88d09d149ae5472c3c64de95110414c2532687.tar.gz
xamarin-forms-3a88d09d149ae5472c3c64de95110414c2532687.tar.bz2
xamarin-forms-3a88d09d149ae5472c3c64de95110414c2532687.zip
Fix Scrolling to Specific Element in ScrollView
- Add the calculation code for getting coordination of given Element : ScrollToAsync() which has Element parameter did not work. It always scroll to (0,0) because there were no calculation code for Element. TASK=TCAPI-2174 Change-Id: I6f3fbdbd060b1c74bc89c25e7e46d99cf10fbf51
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers')
-rwxr-xr-xXamarin.Forms.Platform.Tizen/Renderers/ScrollViewRenderer.cs11
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);
}
}