[英]How to add a user control inside a tabbed page in xamarin.forms
我需要一个页面,如图所示。 读取的椭圆内的图像是使用ContentView
创建的用户控件,我需要一个选项卡式视图,在其中可以实际浏览内容页面,因此我使用了TabbedPage
来实现此目的。 如何可以将用户控制其通用于所有<TabbedPage.Children>
内部TabbedPage
<?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:userControls="clr-namespace:TestApp.View.UserControls;assembly=TestApp"
xmlns:TabControl="clr-namespace:TestApp.View;assembly=TestApp"
x:Class="TestApp.View.TestView"
>
<!--Not working even if I place this on a grid -->
<!--<userControls:ElectionTimer EndDate="{Binding ELDate}"/>-->
<TabbedPage.Children>
<TabControl:AllView Title="All"/>
<TabControl:EducationView Title="Education"/>
<TabControl:HealthView Title="Health"/>
</TabbedPage.Children>
</TabbedPage >
目前您还不能。 您必须创建一个CustomRenderer
或使用CarouselView
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.