diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-10-04 09:34:35 +0200 |
---|---|---|
committer | Stephane Delcroix <stephane@delcroix.org> | 2016-10-04 09:34:35 +0200 |
commit | d34dcf2cbc9dec01c806b64707bbf99c8c58cc8a (patch) | |
tree | b4ff299bb257ddd47f06ef8289b17b31d8bd96db /Xamarin.Forms.Platform.iOS | |
parent | bd195ffe10e713393b9eaaff4f0720227e3ea9c9 (diff) | |
parent | e9606cd6e2bbe60b20d189682c2527751555820a (diff) | |
download | xamarin-forms-d34dcf2cbc9dec01c806b64707bbf99c8c58cc8a.tar.gz xamarin-forms-d34dcf2cbc9dec01c806b64707bbf99c8c58cc8a.tar.bz2 xamarin-forms-d34dcf2cbc9dec01c806b64707bbf99c8c58cc8a.zip |
Merge branch 'ios-scrolltoposition' of https://github.com/adrianknight89/Xamarin.Forms into adrianknight89-ios-scrolltoposition
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs index b2107db7..3d38bb6b 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs @@ -196,6 +196,10 @@ namespace Xamarin.Forms.Platform.iOS else { var positionOnScroll = Controller.GetScrollPositionForElement(e.Element as VisualElement, e.Position); + + positionOnScroll.X = positionOnScroll.X.Clamp(0, ContentSize.Width - Bounds.Size.Width); + positionOnScroll.Y = positionOnScroll.Y.Clamp(0, ContentSize.Height - Bounds.Size.Height); + switch (ScrollView.Orientation) { case ScrollOrientation.Horizontal: |