0

我在呈现 tabbedPage 中的选项卡时遇到问题。

我有两个标签:

选项卡 2:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
         x:Class="Provider.Pages.SignInOut.ProjectFix.TestPage2"             
         Title="Accounted">
<ContentPage.Content>
    <StackLayout><Label Text="asdf454545"></Label></StackLayout>
</ContentPage.Content>

表 1:

    <?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
             x:Class="Provider.Pages.SignInOut.ProjectFix.TestPage"
             Title="Unaccounted">
    <ContentPage.Content>
        <StackLayout>
            <Label Text="asdf"></Label>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

托管这些选项卡的 tabbedPage 是:

 public class TestTabbedPage : TabbedPage 
{
    public TestTabbedPage()
    {
        Children.Add(new TestPage());
        Children.Add(new TestPage2());
    }
}

我在这里遇到的问题是它确实显示了两个选项卡,但最后一个选项卡没有包含名称并且文本不在屏幕上

在此处输入图像描述

如果我使用 Tab 1 而不是 Tab 2 复制页面,则一切正常。

我在标签上做错了什么,为什么标签 2 没有在屏幕上正确显示。

这实际上让我头疼,因为我有一个有两个选项卡的实际项目,但是当呈现这些选项卡时,这些选项卡就消失了。在同一个项目中,我有其他带有标签的页面,但它们都显示得很好。

4

0 回答 0