繁体   English   中英

如何在xamarin.forms的选项卡式页面内添加用户控件

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM