导航到选项卡式页面 [英] Navigating to Tabbed Page

查看:85
本文介绍了导航到选项卡式页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ContentPage(登录页面),应该浏览到我的TabbedPage(TabPage).问题是当我使用代码时:

I have a ContentPage(Login Page) that should navigate to my TabbedPage(TabPage). The problem is when I use the code:

等待Application.Current.MainPage.Navigation.PushModalAsync(new TabbedPage());

await Application.Current.MainPage.Navigation.PushModalAsync(new TabbedPage());

导航到我的标签页未显示任何内容.

to navigate to my tab page is not displaying anything.

当我使用上面的代码时,这就是我看到的:

This is what I am seeing when I use the code above:

这是我设置主页时看到的内容:

And this is what I am seeing when I set the Main Page:

推荐答案

不起作用的原因是您使用Xamarin.Forms.TabbedPage代替了自己的TabbedPage

The Reason it is not working is that you are using the Xamarin.Forms.TabbedPage in place of your own TabbedPage

可以解决您问题的更改

如果这不起作用,请祝你好运

Good luck revert if this does not work

我建议您的Page命名约定应该有所不同,以免混淆自己和编译器.

I would suggest one more thing your Page naming convention should be different so that you do not confuse yourself and the compiler.

例如,如果您的页面上有一个TabbedPage并且它的功能类似于播放音乐和针对不同类型页面的不同标签,则可以将其命名为MusicTabbedPage以更好地理解

For Eg, if your page has a TabbedPage and your functionality for it is something like playing music and different tabs for different types of it then you name it as MusicTabbedPage for better understanding

这篇关于导航到选项卡式页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆