2

I want to add Page/View before TabbedPage, how can I do that?

<?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:views="clr-namespace:TestProject.TabbedPages"  
     x:Class="TestProject.ItemPage"
     Title = "Home Page">
    <TabbedPage.Children>
    <views:AprovedLeaves Title="Approved leaves"/>
    <views:PendingLeaves Title="Pending leaves"/>
    <views:DeniedLeaves Title="Denied leaves"/>
    </TabbedPage.Children>
</TabbedPage>

Above code showing output like this

enter image description here

But I need some space before tabs. Like this

enter image description here

R15
  • 13,982
  • 14
  • 97
  • 173
  • What i do not understand here is what do you mean, when you say you want to add a page/view in front of a TabbedPage! – FreakyAli Mar 18 '19 at 13:23
  • I need some controls to show before tabs, after that I need tab pages. But as of now my tabs are showing on top itself. I want them down. – R15 Mar 18 '19 at 13:25
  • any XF "Page" type is intended to fill the entire screen. You can achieve something close to what you want by using a segmented control instead of tabs – Jason Mar 18 '19 at 14:02

1 Answers1

1

I would suggest you use the Segmented Control Plugin for this look for Plugin.Segmentedon Nuget and install Plugin.SegmentedControl.NetStandard

Initialize it on iOS something like this:

 SegementedControlRenderer.Initialize();  

Then use it in XAML like this

  <control:SegmentedControl x:Name="SegmentedControl" SelectedSegment="{Binding SegmentSelection}" TintColor="White" SelectedTextColor="BlueViolet" DisabledColor="Gray" Margin="8,8,8,8">  
        <control:SegmentedControl.Children>  
            <control:SegmentedControlOption Text="Item 1" />  
            <control:SegmentedControlOption Text="Item 2" />  
            <control:SegmentedControlOption Text="Item 3" />  
            <control:SegmentedControlOption Text="Item 4" />  
        </control:SegmentedControl.Children>  
    </control:SegmentedControl>  

A step by step guide is available on this C# corner blog

Feel free to revert in case of queries

FreakyAli
  • 13,349
  • 3
  • 23
  • 63