ios - 如何消除NavigationBar?

标签 ios xamarin xamarin.ios uinavigationcontroller uinavigationbar

我是 Xamarin iOS 开发新手。 我在我的项目中使用 NavigationController。 我想在特定的 ViewController 中隐藏 NavigationBar。 以下代码隐藏了栏,但没有消除空格。

    public override void ViewWillAppear(bool animated)
    {
        base.ViewWillAppear(animated);
        this.NavigationItem.LeftBarButtonItem = null;
        this.NavigationItem.HidesBackButton = true;
        this.NavigationController.ToolbarHidden = true;
    }

我想消除红色虚线框所示的空间。 enter image description here

最佳答案

NavigationBarHidden 属性设置为 false:

NavigationController.NavigationBarHidden = true;

或者,如果您要为其设置动画,请使用 SetNavigationBarHidden 方法:

动画隐藏:

NavigationController.SetNavigationBarHidden(true, true);

动画展示:

NavigationController.SetNavigationBarHidden(false, true);

回复:iOS NavigationControllers

关于ios - 如何消除NavigationBar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43796327/

相关文章:

ios - NSNotification keyBoardWillShow 和 KeyboardWillHide 未被调用

ios - 应用商店提交

c# - Google Sheets API,在 C# 中为用户获取电子表格

c# - 通过 PCL 创建 MVVM Light ViewModel?适用于 Xamarin.Forms 和 WPF

sqlite - 在iPhone上具有Xamarin应用程序的复制/同步功能的脱机数据?

ios - Xamarin.iOS中的蓝牙背景扫描

Xamarin 中缺少 Azure 移动服务 InvokeApi

ios - 错误 ITMS-90363 : "Invalid Info.plist key. The key ' CFBundleIcons~ipad' in bundle MyApp. 应用程序……

ios - 谷歌应用索引: GSDDeepLink call causes build to fail

iphone - 如何让 MGSplitViewController 在 Monotouch 中工作?