简体   繁体   English

带有TabbedView的Xamarin.Forms MasterDetailPage - 通过汉堡菜单导航时出现标签标题

[英]Xamarin.Forms MasterDetailPage with TabbedView - Tab Title appearing when navigate via burger menu

I'm using Xamarin.Forms in developing an Android and iOS application. 我在开发Android和iOS应用程序时使用Xamarin.Forms。 I've got a MasterDetailPage with a TabbedPage (homepage) as the Detail, which has 5 tabs on it and on the Master page (burger menu) I have two options which are Home or Account. 我有一个带有TabbedPage(主页)的MasterDetailPage作为详细信息,它有5个标签,在主页面上(汉堡菜单)我有两个选项,即主页或帐户。

On iOS the tabs behave as expected in that the burger menu slides out over the top of them. 在iOS上,选项卡的行为与预期的一样,汉堡菜单从顶部滑出。 On Android, the tabs are still clickable along the top of the screen - which I know is a Xamarin thing. 在Android上,选项卡仍然可以在屏幕顶部点击 - 我知道这是一个Xamarin的事情。 It's expected behaviour according to the Xamarin Forums and a Bugzilla report which marks it as "RESOLVED NOT_ON_ROADMAP". 根据Xamarin论坛和Bugzilla报告的预期行为将其标记为“已解决的NOT_ON_ROADMAP”。

My issue is that when I navigate to a different page via the burger menu the title of the tab last selected is still visible at the top of the page in the navigation bar. 我的问题是,当我通过汉堡菜单导航到另一个页面时,导航栏中页面顶部仍然可以看到最后选择的选项卡的标题。 I don't want to get rid of the nav bar as I want the burger icon to appear so the user can still navigate back to the homepage. 我不想摆脱导航栏,因为我想要显示汉堡图标,这样用户仍然可以导航回主页。

Tabbed Page (homepage) 标签页(主页)

Account page - TAB 1 title still appearing 帐户页面 - TAB 1标题仍然出现

How can I get rid of the title on the new page? 如何摆脱新页面上的标题?

21/11/16 EDIT: 2016年11月21日编辑:

The title seems to be attached to the burger icon - I noticed that when I click on the burger menu the whole thing is highlighted not just the icon. 标题似乎附在汉堡图标上 - 我注意到当我点击汉堡菜单时,整个事情不仅突出显示图标。 Is there a title icon or something which is being set? 是否有标题图标或正在设置的内容?

I had the same issue... What you need to do, is hook up on to the OnCurrentPageChanged event of the View where the Tabs are residing on. 我有同样的问题......你需要做的是,连接到Tabs所在的View的OnCurrentPageChanged事件。 In there, change the current title! 在那里,改变当前的标题! Best is to set it to empty string. 最好是将其设置为空字符串。

protected override void OnCurrentPageChanged ()
{
    base.OnCurrentPageChanged ();

    this.Title = string.Empty;
}

In the end we solved this by putting 最后我们通过推杆解决了这个问题

ActionBar.SetDisplayShowTitleEnabled(false);

in the Main Activity of the Android project! 在Android项目的主要活动中!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin / Xamarin.Forms-初始化MasterDetailPage时出现死锁? - Xamarin / Xamarin.Forms - Deadlock when initializing MasterDetailPage? Xamarin.Forms MasterDetailPage 关闭 MasterPageItem - Xamarin.Forms MasterDetailPage dismiss MasterPageItem 在具有Autofac和Xamarin.Forms的MasterDetailPage中使用导航 - Using Navigation in MasterDetailPage with Autofac and Xamarin.Forms Xamarin Forms - 隐藏汉堡菜单 - Xamarin Forms - Hide Burger Menu Xamarin 表单 - 如何禁用 MasterDetailPage 菜单按钮 - Xamarin forms - How to disable MasterDetailPage menu button Xamarin.Forms MasterDetailPage 是否适用于 Kindle VoiceOver 辅助功能 - Does Xamarin.Forms MasterDetailPage work with Kindle VoiceOver accessibility 名称空间xamarin.forms中不存在名称空间名称Masterdetailpage的类型 - type of namespace name Masterdetailpage does not exist in the namespace xamarin.forms MasterDetailPage 背景图像未显示在 xamarin.forms 中的 IOS 中 - MasterDetailPage background image not displaying in IOS in xamarin.forms 具有PropertyChanged.Fody的Xamarin.Forms MasterDetailPage无法正常工作 - Xamarin.Forms MasterDetailPage with PropertyChanged.Fody not working 添加 MasterDetailPage 后 Xamarin.forms 应用程序中的 System.InvalidCastException - System.InvalidCastException in Xamarin.forms application after adding MasterDetailPage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM