summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2016-12-27 01:17:54 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2016-12-27 01:17:54 (GMT)
commit1422e9ef1fbaf6cd8652290f132dd58685d995e9 (patch)
tree8a2714d7212a9434e648d3dc49a2d01e18bb1cc6
parent4678bcda9ae352c0b7fdaaf10e87eef40900369f (diff)
parent35129de4b84e71802c3ba13bad965fe94d134fb9 (diff)
downloadxamarin-forms-1422e9ef1fbaf6cd8652290f132dd58685d995e9.zip
xamarin-forms-1422e9ef1fbaf6cd8652290f132dd58685d995e9.tar.gz
xamarin-forms-1422e9ef1fbaf6cd8652290f132dd58685d995e9.tar.bz2
Merge "Fix Scrolling to Specific Element in ScrollView" into tizen
-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 a566f24..1119538 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);
}
}