зеркало из https://github.com/DeGsoft/maui-linux.git
[iOS] Redirect PreferredStatusBarStyle to the Child View Controller (#1175)
This commit is contained in:
Родитель
6ff3f70257
Коммит
62729d5dad
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using UIKit;
|
||||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
|
||||
|
@ -95,6 +96,17 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
_modal = null;
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
SetNeedsStatusBarAppearanceUpdate();
|
||||
}
|
||||
|
||||
public override UIViewController ChildViewControllerForStatusBarStyle()
|
||||
{
|
||||
return ChildViewControllers?.LastOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
internal class PlatformRenderer : UIViewController
|
||||
|
@ -129,6 +141,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
return (UIViewController)Platform.GetRenderer(this.Platform.Page);
|
||||
}
|
||||
|
||||
public override UIViewController ChildViewControllerForStatusBarStyle()
|
||||
{
|
||||
return ChildViewControllers?.LastOrDefault();
|
||||
}
|
||||
|
||||
public override bool ShouldAutorotate()
|
||||
{
|
||||
if ((ChildViewControllers != null) && (ChildViewControllers.Length > 0))
|
||||
|
@ -167,5 +184,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
Platform.WillAppear();
|
||||
base.ViewWillAppear(animated);
|
||||
}
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
SetNeedsStatusBarAppearanceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче