我已經在 Xamarin Forms 中實作了一個帶有導航抽屜的儀表板。我想洗掉下圖中的藍色部分并將切換按鈕移動到我的設計中。請幫忙

我已經使用 Shell Flyout 實作了如下導航抽屜/浮出控制元件
NavigationPage.SetHasNavigationBar(this, false);
我嘗試使用來自另一個堆疊溢位問題的上述代碼行,但沒有用
uj5u.com熱心網友回復:
根據螢屏截圖,您有兩個彈出頁面。
如果您使用Shell模板,它在默認情況下有一個彈出頁面,當你設定的
FlyoutDisplayOptions到AsMultipleItems。外殼彈出:

請注意,如果您
NavigationPage在 App.xaml.cs 中使用 ,它將顯示如下所示的欄。所以在使用 Flyoutpage 時不要使用它。MainPage = new NavigationPage(new Flyoutpage());
FlyoutPage:https ://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/flyoutpage
uj5u.com熱心網友回復:
我認為 forShell是隱藏此 ActionBar 的錯誤。我在 Shell 中有一個專案,我想盡一切辦法隱藏它,但沒有任何效果。所以我只是處理它:
<ContentPage.ToolbarItems>
<ToolbarItem Text="MyTitle" Order="Primary"/>
<ToolbarItem IconImageSource="img1.png" Order="Primary"/>
<ToolbarItem IconImageSource="img2.png" Order="Primary"/>
<ToolbarItem IconImageSource="img3.png" Order="Primary"/>
</ContentPage.ToolbarItems>
如果需要,您可以洗掉 actionBar 并使用 Shell 的這個 ActionBar 對其進行編輯。
uj5u.com熱心網友回復:
使用Shell.NavBarIsVisible="False"內部內容頁面將
Shell.Current.FlyoutIsPresented = true;在按鈕單擊將打開抽屜。這個答案是在
https://docs.microsoft.com/en-us/answers/questions/349760/how-to-hide-navigation-bar-on-xamarin-forms-when-u.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/326194.html
標籤:沙马林 xamarin.forms
上一篇:如何在Autofac中的scope.Resolve<Service<T>>().Method1()中使用運行時型別引數?
