summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2017-03-24 19:07:59 (GMT)
committerJason Smith <jason.smith@xamarin.com>2017-03-24 19:07:59 (GMT)
commit27de335bf1ce9195e7b1de7ec738176da92b3617 (patch)
tree820c0210f5dd7ac649d2d22e10e42a1b0c00526e /Xamarin.Forms.Platform.iOS
parent377d24fd05e7fb597c4f9237c1596ed4fbf86f19 (diff)
downloadxamarin-forms-27de335bf1ce9195e7b1de7ec738176da92b3617.zip
xamarin-forms-27de335bf1ce9195e7b1de7ec738176da92b3617.tar.gz
xamarin-forms-27de335bf1ce9195e7b1de7ec738176da92b3617.tar.bz2
[iOS] Platform specifics to control ScrollView content touch delay (#563)
* can delay content touches optionally * revert bug fix * add back _tapGesture * remove extra declaration
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
index 244edfa..1fe2edb 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
@@ -2,6 +2,7 @@ using System;
using System.ComponentModel;
using Xamarin.Forms.Internals;
using UIKit;
+using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
using PointF = CoreGraphics.CGPoint;
using RectangleF = CoreGraphics.CGRect;
@@ -66,8 +67,6 @@ namespace Xamarin.Forms.Platform.iOS
((IScrollViewController)element).ScrollToRequested += OnScrollToRequested;
if (_packager == null)
{
- DelaysContentTouches = true;
-
_packager = new VisualElementPackager(this);
_packager.Load();
@@ -84,6 +83,7 @@ namespace Xamarin.Forms.Platform.iOS
});
}
+ UpdateDelaysContentTouches();
UpdateContentSize();
UpdateBackgroundColor();
@@ -165,7 +165,9 @@ namespace Xamarin.Forms.Platform.iOS
void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if (e.PropertyName == ScrollView.ContentSizeProperty.PropertyName)
+ if (e.PropertyName == PlatformConfiguration.iOSSpecific.ScrollView.ShouldDelayContentTouchesProperty.PropertyName)
+ UpdateDelaysContentTouches();
+ else if (e.PropertyName == ScrollView.ContentSizeProperty.PropertyName)
UpdateContentSize();
else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
UpdateBackgroundColor();
@@ -220,6 +222,11 @@ namespace Xamarin.Forms.Platform.iOS
Controller.SendScrollFinished();
}
+ void UpdateDelaysContentTouches()
+ {
+ DelaysContentTouches = ((ScrollView)Element).OnThisPlatform().ShouldDelayContentTouches();
+ }
+
void UpdateBackgroundColor()
{
BackgroundColor = Element.BackgroundColor.ToUIColor(Color.Transparent);