2017-07-15 76 views
0

嗨我尝试开发与Xamarin我的第一个跨应用程序,我尝试做一个选项卡式页面。 我的XAML代码是Xamarin表格选项卡式页面

<?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="using:MyTimesheet.Pages" 

      x:Class="MyTimesheet.MainRootPage"> 
    <!--Pages can be added as references or inline--> 

    <local:Page1></local:Page1> 
    <local:Page2></local:Page2> 
</TabbedPage> 

我的第1页第2页的XAML代码是相同的:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
      x:Class="MyTimesheet.Pages.ClientiPage"> 
    <ContentPage.Content> 
     <StackLayout> 
      <Label Text="Welcome Clienti" /> 
     </StackLayout> 
    </ContentPage.Content> 
</ContentPage> 

我发现,用我的计算策略,但是当我建立一个解决方案我的错误更例如:

找不到类型“TabbedPage”。 找不到类型'local:page1'。

有什么不对? 三江源认为

所需的截图: enter image description here

新的错误 - 新的截图:

+0

可以打印确切的错误语句并在此处上传? – lowleetak

+0

我有视觉工作室不是英文,所以我traslate错误 –

+0

尝试检查xmlns:本地。它应该是这样的格式:xmlns:local =“clr-namespace:MyTimesheet.Pages; assembly = MyTimesheet” – lowleetak

回答

0

我使用ReSharper的,它显示了我两个问题:

  1. 这段代码是错误的xmlns:local="using:MyTimesheet.Pages",你必须将其更改为xmlns:local="clr-namespace:MyTimesheet.Pages,assembly=MyTimesheet"
  2. 检查后面的TabbedPage代码(TabbedPage.xaml.cs)和我Visual Studio创建以下错误代码public partial class TabbedPage : TabbedPage,删除继承(使用public partial class TabbedPage),对我来说,它的工作原理。

我希望这可以帮助你。