【发布时间】:2017-10-19 06:30:07
【问题描述】:
我想隐藏 UINavigation Bar 并且只显示 Rootview 控制器的状态栏。 this.NavigationController.SetNavigationBarHidden(true, true);
两者都隐藏。现在它看起来像 this 。
【问题讨论】:
标签: xamarin xamarin.ios
我想隐藏 UINavigation Bar 并且只显示 Rootview 控制器的状态栏。 this.NavigationController.SetNavigationBarHidden(true, true);
两者都隐藏。现在它看起来像 this 。
【问题讨论】:
标签: xamarin xamarin.ios
因此,您的屏幕截图显示了状态栏,但没有显示导航栏。代码可以正常工作。
有关如何隐藏/显示状态栏和导航栏的更多详细信息,请参阅以下部分:
要隐藏/显示状态栏,您需要在 info.plist 文件中添加此设置:
<key>UIViewControllerBasedStatusBarAppearance</key>
<false />
然后在你的 ViewController 中添加代码:
UIApplication.SharedApplication.SetStatusBarHidden(true/false,true);
要隐藏/显示导航栏,只需在ViewWillAppear中添加代码:
this.NavigationController.SetNavigationBarHidden(true/false, true);
【讨论】:
抱歉,我没有足够的声誉,无法发表评论。
从您附加的图片和问题中隐藏 UINavigationBar 并仅显示状态栏,看起来它是正确的并且您的代码也是正确的。
附件是您可能正在寻找的答案:How to hide Navigation Controller in Root View?
【讨论】: