我试图将一些自定义内容页面放入选项卡页面 . 遗憾的是,我不确定,如何使用XAML语法执行此操作 . 我的虚拟项目如下所示:
第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="MyApp.Pages.Page1">
<Label Text="Page 1" VerticalOptions="Center" HorizontalOptions="Center" />
</ContentPage>
第2页完全相同 . 标签页:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Pages.Navigation">
<ContentPage x:Class="MyApp.Pages.Page1" Title="Home">
</ContentPage>
<ContentPage x:Class="MyApp.Pages.Page2" Title="Browse">
</ContentPage>
</TabbedPage>
页面不会出现?我该怎么做呢?
2 回答
你做错了 . 您必须将页面放置为TabbedPage Children .
这是解决方案:
另外,您可以通过编程方式执行此操作:
您正在寻找TabbedPage上的Children属性