summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2016-11-30 20:09:57 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-11-30 20:09:57 (GMT)
commitccef9cbaa45aed957e44864033fffa815b521d6b (patch)
treed313efbb935f3703276829ac51d74678a7981eb7 /Xamarin.Forms.Platform.iOS
parent2600a02543159c1a36fa16a8225d83b5ff5ff80e (diff)
downloadxamarin-forms-ccef9cbaa45aed957e44864033fffa815b521d6b.zip
xamarin-forms-ccef9cbaa45aed957e44864033fffa815b521d6b.tar.gz
xamarin-forms-ccef9cbaa45aed957e44864033fffa815b521d6b.tar.bz2
[iOS] Avoid using DrawRect on base VisualElementRenderer (#570)
* [Controls] Add retro for Bugzilla 48158 * [iOS] Avoid using DrawRect as this will make some properties not being applied to the layer * [iOS] Make sure BoxRenderer calls base LayoutSubviews * [iOS] Better fix for adding the Blur effect and avoid override draw’s * [Controls] Remove extra nunit category
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/BoxRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs11
2 files changed, 7 insertions, 6 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/BoxRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/BoxRenderer.cs
index 466773b..f2b9253 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/BoxRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/BoxRenderer.cs
@@ -26,6 +26,8 @@ namespace Xamarin.Forms.Platform.iOS
{
if (_previousSize != Bounds.Size)
SetNeedsDisplay();
+
+ base.LayoutSubviews();
}
protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
index b4a60f6..bb97185 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
@@ -170,17 +170,16 @@ namespace Xamarin.Forms.Platform.iOS
return new SizeF(0, 0);
}
- public override void Draw(RectangleF rect)
+ public override void LayoutSubviews()
{
- base.Draw(rect);
- if (_blur != null)
+ base.LayoutSubviews();
+ if (_blur != null && Superview != null)
{
- _blur.Frame = rect;
+ _blur.Frame = Bounds;
if (_blur.Superview == null)
Superview.Add(_blur);
}
}
-
protected override void Dispose(bool disposing)
{
if ((_flags & VisualElementRendererFlags.Disposed) != 0)
@@ -289,7 +288,7 @@ namespace Xamarin.Forms.Platform.iOS
}
_blur = new UIVisualEffectView(blurEffect);
- SetNeedsDisplay();
+ LayoutSubviews();
}
protected virtual void UpdateNativeWidget()