diff options
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs index f9802a21..25527dfb 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/TabbedRenderer.cs @@ -4,6 +4,8 @@ using System.Collections.Specialized; using System.ComponentModel; using UIKit; using Xamarin.Forms.Internals; +using static Xamarin.Forms.PlatformConfiguration.iOSSpecific.Page; +using PageUIStatusBarAnimation = Xamarin.Forms.PlatformConfiguration.iOSSpecific.UIStatusBarAnimation; namespace Xamarin.Forms.Platform.iOS { @@ -241,6 +243,29 @@ namespace Xamarin.Forms.Platform.iOS UpdateBarBackgroundColor(); else if (e.PropertyName == TabbedPage.BarTextColorProperty.PropertyName) UpdateBarTextColor(); + else if (e.PropertyName == PrefersStatusBarHiddenProperty.PropertyName) + UpdatePrefersStatusBarHiddenOnPages(); + else if (e.PropertyName == PreferredStatusBarUpdateAnimationProperty.PropertyName) + UpdateCurrentPagePreferredStatusBarUpdateAnimation(); + } + + public override UIViewController ChildViewControllerForStatusBarHidden() + { + return GetViewController(Tabbed.CurrentPage); + } + + void UpdateCurrentPagePreferredStatusBarUpdateAnimation() + { + PageUIStatusBarAnimation animation = ((Page)Element).OnThisPlatform().PreferredStatusBarUpdateAnimation(); + Tabbed.CurrentPage.OnThisPlatform().SetPreferredStatusBarUpdateAnimation(animation); + } + + void UpdatePrefersStatusBarHiddenOnPages() + { + for (var i = 0; i < ViewControllers.Length; i++) + { + Tabbed.GetPageByIndex(i).OnThisPlatform().SetPrefersStatusBarHidden(Tabbed.OnThisPlatform().PrefersStatusBarHidden()); + } } void Reset() |