在 Xamarin.Forms 中使导航栏消失 [英] Making a nav bar disappear in Xamarin.Forms
本文介绍了在 Xamarin.Forms 中使导航栏消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 Xamarin.Forms 和 C# 的新手,我想知道如何在 NavigationPage 中呈现一堆页面,而不显示导航栏.到目前为止,这是我在 App.cs 中的代码:
I'm completely new to Xamarin.Forms and C#, and I'm wondering how I can present a stack of Pages within a NavigationPage, without showing the navigation bar. Here's my code so far in App.cs:
using Xamarin.Forms;
namespace Test
{
public class App
{
public static Page GetMainPage ()
{
return new NavigationPage (new StartPage ());
}
}
}
我该怎么做才能使 StartPage
出现时,导航栏在屏幕上不可见?
What can I do to make it so that when StartPage
is presented, a navigation bar isn't visible on the screen?
推荐答案
在 StartPage 中,添加这个(在构造函数或 ViewAppearing 中)
In StartPage, add this (in the constructor or ViewAppearing)
NavigationPage.SetHasNavigationBar(this, false);
这篇关于在 Xamarin.Forms 中使导航栏消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文