簡體   English   中英

導航欄無法隱藏 xamarin forms

[英]navigation bar can't hide xamarin forms

這是我的詳細信息頁面

公共詳細信息頁面(屬性屬性){

        Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
        Xamarin.Forms.NavigationPage.SetHasBackButton(this, false);
        InitializeComponent();
     
        this.Property = property;
        this.BindingContext = this;
              }

在我的 XAML 代碼中,我添加了這些行

NavigationPage.HasNavigationBar="False" NavigationPage.HasBackButton="False"

但無法隱藏詳細信息頁面中的導航欄

我注意到在您的自定義基本頁面上或基本上在 XAML 上執行此操作比在您可能的代碼中執行此操作更好,在不知不覺中將其更改在錯誤的位置做我所做的就是這樣

<ContentPage
x:Class="Proj.BaseContentPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
NavigationPage.HasBackButton="False"
NavigationPage.HasNavigationBar="False">

如果您有任何問題,Goodluck 隨時回復

這是我的內容頁面

 <ContentPage 

               
xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="App6.DetailsPage"     
             NavigationPage.HasBackButton="False"
             NavigationPage.HasNavigationBar="False"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:pv="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
         >

這是我的 InitializeComponent();

   public DetailsPage(Property property)
    {
        Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
        Xamarin.Forms.NavigationPage.SetHasBackButton(this, false);
        InitializeComponent();
       
        this.Property = property;
        this.BindingContext = this;
        //idds = property.Id.ToString();
        //idd = Property.Id.ToString();
        //alert( idd);
    }

但我的導航面板沒有被隱藏

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM