Close
Topic : User Interface » Xamarin.Forms » Tabbed Page:



Tabbed Page:

The TabbedPage consists a list of Different Tabs that contain some information. We have experience with tabs in Different Application just like Play store, a Music App Facebook, or Instagram etc that contains different tabs and we can navigate from one tab to another by just a click.



tabbed page : infobrother

Creating a TabbedPage:

Creating a Tabbed page Using Xamarin.forms is very simple, we just need to create different pages and then Populate the TabbedPage with a collection of these pages objects.



It is recommended that a TabbedPage should be Populated with Navigation Page and ContentPage Instance only. This will help to ensure a consistent user experience across all platforms.


In Order to create the tabbed Page, First of All we need to Create the Different Content pages. Follow the given steps to create the Content Pages.



Create page: infobrother
  • 1 » Right click on your project and Add » New Item.
    2 » Select the Content Page from Visual C# Items tab.
    3 » Give it a name and add it in Your Project.



Using Above Steps, create different pages, and Include your desired information to display. Then Open your MainPage.XAML file to Construct the TabbedPage by Populating it with a collection of Contents Page that we created above.

The Following Code shows a Tabbed Page Constructed by Populating it with a Collection of Child Page Objects.


<?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:local="clr-namespace:TabbedPageDemo"
             x:Class="TabbedPageDemo.MainPage">

    <local:Cplusplus />
    <local:csharp />
    <local:xamarin />

</TabbedPage>
using Xamarin.Forms;

namespace TabbedPageDemo
{
    public partial class MainPage : TabbedPage
    {
	public MainPage()
	{
   	   InitializeComponent();

           Children.Add(new Cplusplus());
           Children.Add(new csharp());
           Children.Add(new xamarin());
	}
    }
}


In Above Code, The TabbedPage is Populated with three different ContentPage objects which are Cplusplus, Csharp, and Xamarin. we can create Navigation page inside the Tabbed page. But The tabbedPage does not support User interface Virtualization. therefore, performance may be affected if the TabbedPage contains too many Child Elements.



















I Tried my Best to Provide you complete Information regarding this topic in very easy and conceptual way. but still if you have any Problem to understand this topic, or do you have any Questions, Feel Free to Ask Question. i'll do my best to Provide you what you need.

Sardar Omar.
InfoBrother





WRITE FOR INFOBROTHER

Advertising






Advertisement