我正在使用 Xamarin Forms (v2.3.1.114) 和 FreshMVVM 实现主详细信息导航,其中第一页是选项卡式导航。对于实现,我使用FreshMVVM 自定义 Navigation Sample。
导航在 Android 和 iOS 上运行良好,但在 UWP 上,主导航按钮不显示。
这是我的导航代码的一部分
FreshTabbedNavigationContainer _mainTabs;
void Setup()
{
_mainTabs = new FreshTabbedNavigationContainer();
_mainTabs.AddTab<MyRewardsPageModel>("My Rewards", null);
_mainTabs.AddTab<MapPageModel>("Map", null);
_mainTabs.AddTab<NearbyPageModel>("Near You", null);
_contactusPage = FreshPageModelResolver.ResolvePageModel<ContactUsPageModel>();
_aboutUsPage = FreshPageModelResolver.ResolvePageModel<AboutUsPageModel>();
}
void CreateMenuPage(string menu)
{
var menuPage = new ContentPage { Title = menu };
var listView = new ListView { ItemsSource = new string[] { "Home", "Contact Us", "About Us" } };
listView.ItemSelected += (sender, args) =>
{
switch ((string)args.SelectedItem)
{
case "Home":
Detail = _mainTabs;
break;
case "Contact Us":
Detail = new NavigationPage(_contactusPage);
break;
case "About Us":
Detail = new NavigationPage(_contactusPage);
break;
default:
break;
}
IsPresented = false;
};
IsPresented = true;
menuPage.Content = listView;
Detail = _mainTabs;
Master = new NavigationPage(menuPage)
{
Title = menu,
BarBackgroundColor = Color.Green,
BarTextColor = Color.Black
};
}
这是 Xamarin Forms 错误还是我的实现?任何建议都非常感谢