使用Caliburn.Micro删除Xamarin Forms应用程序上的导航栏 [英] Remove navigation bar on Xamarin Forms app with Caliburn.Micro

查看:94
本文介绍了使用Caliburn.Micro删除Xamarin Forms应用程序上的导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Caliburn.Micro的全新Xamarin.Forms应用程序使用FormsApplication基类时,最终在屏幕顶部出现一个空的导航栏.我认为它是由Caliburn.Micro以某种方式创建的,因为开箱即用的Xamarin.Forms应用程序不具备此功能.

When using the FormsApplication base class with a brand new Xamarin.Forms app using Caliburn.Micro, I end up with an empty navigation bar at the top of my screen. I assume it's being created by Caliburn.Micro somehow, because an out-of-the-box Xamarin.Forms app doesn't have that.

在没有此导航栏的情况下,有什么方法可以将Caliburn.Micro与Xamarin.Forms一起使用吗?

Is there any way I can use Caliburn.Micro with Xamarin.Forms without this navigation bar?

推荐答案

我没有使用Caliburn.Micro,但是我假设它使用NavigationPage包裹了您的页面,因为您所描述的是如果如此.

I have not used Caliburn.Micro, but I am assuming that it is wrapping your page with a NavigationPage, as what you describe is what would happen if so.

您应该可以通过在页面中设置一个简单的属性来隐藏导航栏,如下所示:

You should be able to hide that navigation bar by setting a simple attribute in your page like so:

<ContentPage NavigationPage.HasNavigationBar="false"
    ..... >
</ContentPage>

如果您不使用XAML页面,而是在代码中使用所有UI,则可以在页面构造函数中以这种方式进行操作:

If you are not using XAML pages and doing all of your UI in code instead, then you can do it this way within your page constructor:

NavigationPage.SetHasNavigationBar(this, false);

这篇关于使用Caliburn.Micro删除Xamarin Forms应用程序上的导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆