微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 TabbePage

如何解决使用 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 举报,一经查实,本站将立刻删除。