Xamarin.Forms: 离开主页面的导航失去了箭头

问题描述 投票:0回答:1

我在我的主详情页里有一个小抽屉菜单。我有一个可点击的选项列表,有些选项可以将你导航到另一个屏幕。

Application.Current.MainPage = new NavigationPage(new Screen_Profile("", true));

但这样一来,导航箭头就会消失,无法返回。如果你在安卓上点击回去,之后应用就会关闭。

如何才能导航离开主详情页,还能有箭头直接回到主页面?

谢谢你!

xamarin xamarin.forms
1个回答
0
投票

你只想更新 Detail 页,你的整个 MainPage

var mdPage = (MasterDetailPage)Application.Current.MainPage;
mdPage.Detail = new NavigationPage(new Screen_Profile("", true));

这将使 Master 在您导航时,页面的菜单部分是活动的。

© www.soinside.com 2019 - 2024. All rights reserved.