首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >泽马林中的TabbedPage

泽马林中的TabbedPage
EN

Stack Overflow用户
提问于 2018-09-26 07:46:10
回答 1查看 130关注 0票数 0

我试着用TabbedPage制作

UserTabbedPage.xaml

代码语言:javascript
复制
<?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.General.Users.UserProfile;assembly=MyApp"
            x:Class="MyApp.General.Users.UserProfile.UserTabbedPage">
    <local:UserPage />
</TabbedPage>

UserTabbedPage.xaml.cs

代码语言:javascript
复制
using System;
using System.Collections.Generic;
using Xamarin.Forms;

namespace MyApp.General.Users.UserProfile
{
    public partial class UserTabbedPage : TabbedPage
    {
        public UserTabbedPage()
        {
            InitializeComponent();
        }
    }
}

UserPage.xaml

代码语言:javascript
复制
<?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="MyApp.General.Users.UserProfile.UserPage">
    <ContentPage.Content>
    </ContentPage.Content>
</ContentPage>

UserPage.xaml.cs

代码语言:javascript
复制
using System;
using System.Collections.Generic;
using Xamarin.Forms;

namespace MyApp.General.Users.UserProfile
{
    public partial class UserPage : ContentPage
    {
        public UserPage(User user)
        {
            InitializeComponent();
        }
    }
}

但我错了:字典中没有给定的键'Xamarin.Forms.Xaml.ElementNode‘

当我从User user中删除public UserPage(User user)时,错误就会消失。但是以后我需要在构造函数中使用这个类。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-09-26 08:11:47

通过添加不带参数的第二个构造函数来求解

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52512546

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档