简体   繁体   中英

How to add a user control inside a tabbed page in xamarin.forms

用户控制问题

I need a page to be designed as in the picture. Image inside the read ellipse is a user control created using of a ContentView I need a tabbed view where I can actually swipe through the content pages so I used a TabbedPage for this purpose. how can I place the user control which is common to all <TabbedPage.Children> inside the 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 >

Currently you can't. You'll have to create a CustomRenderer or use CarouselView .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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