summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorSandro Cavazzoni <sandro@ideaful.it>2017-01-12 19:38:24 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-01-12 19:38:24 (GMT)
commitf81e41b11b4e1398f67f047725c2b3438094d5f8 (patch)
tree2fc8916529a69b01ec5c1f87e49ae43889e53b09 /Xamarin.Forms.Platform.iOS
parent16164132156fd799d76c8a88c11627dc66cecbf3 (diff)
downloadxamarin-forms-f81e41b11b4e1398f67f047725c2b3438094d5f8.zip
xamarin-forms-f81e41b11b4e1398f67f047725c2b3438094d5f8.tar.gz
xamarin-forms-f81e41b11b4e1398f67f047725c2b3438094d5f8.tar.bz2
[iOS] Fix child view position when the Navigation Bar is translucent (#659)
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
index 6af4021..6b698f2 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
@@ -154,7 +154,7 @@ namespace Xamarin.Forms.Platform.iOS
var toolbar = _secondaryToolbar;
// Use 0 if the NavBar is hidden or will be hidden
- var toolbarY = NavigationBarHidden || !NavigationPage.GetHasNavigationBar(Current) ? 0 : navBarFrame.Bottom;
+ var toolbarY = NavigationBarHidden || NavigationBar.Translucent || !NavigationPage.GetHasNavigationBar(Current) ? 0 : navBarFrame.Bottom;
toolbar.Frame = new RectangleF(0, toolbarY, View.Frame.Width, toolbar.Frame.Height);
double trueBottom = toolbar.Hidden ? toolbarY : toolbar.Frame.Bottom;
@@ -824,7 +824,13 @@ namespace Xamarin.Forms.Platform.iOS
public override void ViewWillAppear(bool animated)
{
UpdateNavigationBarVisibility(animated);
- EdgesForExtendedLayout = UIRectEdge.None;
+
+ NavigationRenderer n;
+ var isTranslucent = false;
+ if (_navigation.TryGetTarget(out n))
+ isTranslucent = n.NavigationBar.Translucent;
+ EdgesForExtendedLayout = isTranslucent ? UIRectEdge.All : UIRectEdge.None;
+
base.ViewWillAppear(animated);
}