[iOS] Fix child view position when the Navigation Bar is translucent (#659)

This commit is contained in:
Sandro Cavazzoni 2017-01-12 20:38:24 +01:00 коммит произвёл Rui Marinho
Родитель 1616413215
Коммит f81e41b11b
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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);
}