簡體   English   中英

Xamarin.Forms AppCompat MasterDetail沒有標題欄顯示

[英]Xamarin.Forms AppCompat MasterDetail no titlebar showing

我對Xamarin.Forms(v2.3)有問題

我遵循了此指南: https : //developer.xamarin.com/guides/xamarin-forms/platform-features/android/appcompat/

到目前為止,我已經能夠將Material設計成功集成到Forms應用程序中。

實際上我不希望使用的是MasterDetail,它是我從LoginPage用以下行調用的:

await Navigation.PushModalAsync(new HomePage());

在以下屏幕截圖中可以看到什么不起作用:

在此處輸入圖片說明

在此處輸入圖片說明

會顯示MasterDetail,但是帶有標題和漢堡徽標的標題欄不會顯示。 這是描述我的MasterDetail的代碼:

<MasterDetailPage
  xmlns="http://xamarin.com/schemas/2014/forms"
  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  x:Class="MyClassPath"
  Title="Care Page">

  <MasterDetailPage.Master>
    <ContentPage Title="Title">
      <Label/>
    </ContentPage>
  </MasterDetailPage.Master>

  <MasterDetailPage.Detail>
    <ContentPage Title="Title">
      <Label/>
    </ContentPage>
  </MasterDetailPage.Detail>

 </MasterDetailPage>

您需要具有一個NavigationPage來顯示標題和圖標,以便您可以將詳細信息設置為NavigationPage。

例如 :

Detail = new NavigationPage(new ContentPage { Title = "Title" });

暫無
暫無

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

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