【发布时间】:2018-03-16 17:07:16
【问题描述】:
我用 3 个标签实现 TabbedPage,如下图所示。
在这 3 个选项卡之上,我正在尝试设置一个标题,这对于所有 3 个选项卡都是通用的。尝试了标签页的标题属性,但没有奏效。
MyTabbedpage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Myapp;assembly=Myapp"
BarBackgroundColor="#1C7DB4"
BarTextColor="White"
x:Class="Myapp.MyTabbedPage">
</TabbedPage>
MyTabbedpage.xaml.cs
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Myapp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MyTabbedPage : TabbedPage
{
public MyTabbedPage(bool value)
{
InitializeComponent();
Children.Add(new Topics());
Children.Add(new Group());
Children.Add(new Menu());
}
protected override bool OnBackButtonPressed()
{
return false;
}
}
}
请提出解决方案。
【问题讨论】:
标签: xamarin.forms tabs