* [iOS] Fix usage of iOS11 api

* [iOS] Fix remaining calls to HomeIndicatorHidden feature
This commit is contained in:
Rui Marinho 2019-04-15 22:24:50 +01:00 коммит произвёл Samantha Houts
Родитель 620c059b1b
Коммит 4f0724fc4c
4 изменённых файлов: 17 добавлений и 12 удалений

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

@ -47,7 +47,7 @@ namespace Xamarin.Forms.Platform.iOS
{
return ChildViewControllers[0].GetSupportedInterfaceOrientations();
}
return base.GetSupportedInterfaceOrientations();
}
@ -104,7 +104,8 @@ namespace Xamarin.Forms.Platform.iOS
{
base.ViewDidLoad();
SetNeedsStatusBarAppearanceUpdate();
SetNeedsUpdateOfHomeIndicatorAutoHidden();
if (Forms.IsiOS11OrNewer)
SetNeedsUpdateOfHomeIndicatorAutoHidden();
}
public override UIViewController ChildViewControllerForStatusBarStyle()
@ -139,7 +140,7 @@ namespace Xamarin.Forms.Platform.iOS
}
return base.PreferredInterfaceOrientationForPresentation();
}
public override UIViewController ChildViewControllerForStatusBarHidden()
{
return (UIViewController)Platform.GetRenderer(this.Platform.Page);
@ -198,7 +199,8 @@ namespace Xamarin.Forms.Platform.iOS
{
base.ViewDidLoad();
SetNeedsStatusBarAppearanceUpdate();
SetNeedsUpdateOfHomeIndicatorAutoHidden();
if (Forms.IsiOS11OrNewer)
SetNeedsUpdateOfHomeIndicatorAutoHidden();
}
}
}

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

@ -231,7 +231,8 @@ namespace Xamarin.Forms.Platform.iOS
UpdateBarTextColor();
UpdateUseLargeTitles();
UpdateHideNavigationBarSeparator();
SetNeedsUpdateOfHomeIndicatorAutoHidden();
if (Forms.IsiOS11OrNewer)
SetNeedsUpdateOfHomeIndicatorAutoHidden();
// If there is already stuff on the stack we need to push it
navPage.Pages.ForEach(async p => await PushPageAsync(p, false));
@ -724,9 +725,9 @@ namespace Xamarin.Forms.Platform.iOS
{
if (NavPage == null)
return;
if (_ignorePopCall)
if (_ignorePopCall)
return;
_ignorePopCall = true;
if (Element.Navigation.NavigationStack.Contains(pageBeingRemoved))
await (NavPage as INavigationPageController)?.RemoveAsyncInner(pageBeingRemoved, false, true);
@ -1347,7 +1348,7 @@ namespace Xamarin.Forms.Platform.iOS
break;
}
else if(view.Class.Name == "UINavigationItemButtonView")
else if (view.Class.Name == "UINavigationItemButtonView")
{
if (view.Subviews.Length == 0)
NavBarLabel = null;
@ -1475,7 +1476,7 @@ namespace Xamarin.Forms.Platform.iOS
if (_child.Element.Bounds != layoutBounds)
Layout.LayoutChildIntoBoundingRegion(_child.Element, layoutBounds);
}
else if(_icon != null && Superview != null)
else if (_icon != null && Superview != null)
{
_icon.Center = new PointF(Superview.Frame.Width / 2 - Frame.X, Superview.Frame.Height / 2);
}

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

@ -171,7 +171,8 @@ namespace Xamarin.Forms.Platform.iOS
_appeared = true;
UpdateStatusBarPrefersHidden();
SetNeedsUpdateOfHomeIndicatorAutoHidden();
if(Forms.IsiOS11OrNewer)
SetNeedsUpdateOfHomeIndicatorAutoHidden();
if (Element.Parent is CarouselPage)
return;
@ -439,7 +440,7 @@ namespace Xamarin.Forms.Platform.iOS
void UpdateHomeIndicatorAutoHidden()
{
if (Element == null)
if (Element == null || !Forms.IsiOS11OrNewer)
return;
SetNeedsUpdateOfHomeIndicatorAutoHidden();

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

@ -336,7 +336,8 @@ namespace Xamarin.Forms.Platform.iOS
_detailController.AddChildViewController(detailRenderer.ViewController);
SetNeedsStatusBarAppearanceUpdate();
SetNeedsUpdateOfHomeIndicatorAutoHidden();
if (Forms.IsiOS11OrNewer)
SetNeedsUpdateOfHomeIndicatorAutoHidden();
}
void UpdateLeftBarButton()