使用 TabbePage

问题描述

我正在处理一个 Xamarin 项目并创建了一个 TabbedPage (HomePage.xaml),并将 xmlns 设置为该项目以引用任何添加内容页面。 我是 Xamarin 的新手,所以不确定我的错误是什么,但我遵循了一个例子,似乎我看不到我添加到我的项目中的任何内容页面。

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TicketStore"
             x:Class="TicketStore.HomePage">
        <local:MainPage/>
        <local:HockeyPage/>
        <local:FootballPage/>
        <local:BasketballPage/>
 </TabbedPage>

从上面的代码中,只有 <local:MainPage/> 可以被引用,其他页面显示错误。 详细的错误是:

/Users/stephen/Projects/TicketStore/TicketStore/HomePage.xaml(5,5): Error: XLS0414: The type 'local:HockeyPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. (TicketStore) IntelliSense

我在网上查找了其他示例,但没有发现我做的任何不同之处。

这是主页内容文件的 .xaml.cs 代码

using System;
using System.Collections.Generic;

using Xamarin.Forms;

namespace TicketStore
{
    public partial class HomePage : TabbedPage
    {
        public HomePage()
        {
            InitializeComponent();
        }
    }
}

感谢这里的任何帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)