Xamarin forms put search bar on top tabbed page năm 2024

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

There's been talk about just creating a FormsTabBar that's all Forms components that we could do this with which would make this possible or we could reuse the shell implementation

PureWeen added e/6 🕕

6

help wanted

We welcome community contributions to any issue, but these might be a good place to start!

up-for-grabs

We welcome community contributions to any issue, but these might be a good place to start!

labels

Throwing my vote in too. I realize it's not "native" to iOS, but it seems like Forms is moving away from that anyways.

We could keep the android attached property for compatibility, but then add the same property directly to the current NavigationPage as net new.

this.ToolbarPlacement = "Default" (top for droid, bottom for touch,???UWP et al)
this.ToolbarPlacement = "Top | Bottom" for consistency across platforms.

Could even leverage the work already done in naxam

Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.

If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Xamarin.Forms TabbedPage

  • Article
  • 05/26/2022

In this article

Xamarin forms put search bar on top tabbed page năm 2024
Download the sample

The Xamarin.Forms TabbedPage consists of a list of tabs and a larger detail area, with each tab loading content into the detail area. The following screenshots show a TabbedPage on iOS and Android:

On iOS, the list of tabs appears at the bottom of the screen, and the detail area is above. Each tab consists of a title and an icon, which should be a PNG file with an alpha channel. In portrait orientation, tab bar icons appear above tab titles. In landscape orientation, icons and titles appear side by side. In addition, a regular or compact tab bar may be displayed, depending on the device and orientation. If there are more than five tabs, a More tab will appear, which can be used to access the additional tabs.

On Android, the list of tabs appears at the top of the screen, and the detail area is below. Each tab consists of a title and an icon, which should be a PNG file with an alpha channel. However, the tabs can be moved to the bottom of the screen with a platform-specific. If there are more than five tabs, and the tab list is at the bottom of the screen, a More tab will appear that can be used to access the additional tabs. For information about icon requirements, see on material.io and Support different pixel densities on developer.android.com. For information about moving the tabs to the bottom of the screen, see Setting TabbedPage Toolbar Placement and Color.

On the Universal Windows Platform (UWP), the list of tabs appears at the top of the screen, and the details area is below. Each tab consists of a title. However, icons can be added to each tab with a platform-specific. For more information, see TabbedPage Icons on Windows.

Tip

Scalable Vector Graphic (SVG) files can be displayed as tab icons on a TabbedPage:

  • The iOS TabbedRenderer class has an overridable GetIcon method that can be used to load tab icons from a specified source. In addition, selected and unselected versions of an icon can be provided if required.
  • The Android AppCompat

    public class MainPageCS : TabbedPage { public MainPageCS () {

    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());  
    navigationPage.IconImageSource = "schedule.png";  
    navigationPage.Title = "Schedule";  
    Children.Add (new TodayPageCS ());  
    Children.Add (navigationPage);  
    
    } }

    0 class has an overridable

    public class MainPageCS : TabbedPage { public MainPageCS () {

    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());  
    navigationPage.IconImageSource = "schedule.png";  
    navigationPage.Title = "Schedule";  
    Children.Add (new TodayPageCS ());  
    Children.Add (navigationPage);  
    
    } }

    1 method that can be used to load tab icons from a custom

    public class MainPageCS : TabbedPage { public MainPageCS () {

    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());  
    navigationPage.IconImageSource = "schedule.png";  
    navigationPage.Title = "Schedule";  
    Children.Add (new TodayPageCS ());  
    Children.Add (navigationPage);  
    
    } }

    2. Alternatively, SVG files can be converted to vector drawable resources, which can automatically be displayed by Xamarin.Forms. For more information about converting SVG files to vector drawable resources, see Add multi-density vector graphics on developer.android.com.

For more information, see Xamarin.Forms TabbedPage with SVG tab icons.

Create a TabbedPage

Two approaches can be used to create a TabbedPage:

  • Populate the TabbedPage with a collection of child

    public class MainPageCS : TabbedPage { public MainPageCS () {

    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());  
    navigationPage.IconImageSource = "schedule.png";  
    navigationPage.Title = "Schedule";  
    Children.Add (new TodayPageCS ());  
    Children.Add (navigationPage);  
    
    } }

    5 objects, such as a collection of

    public class MainPageCS : TabbedPage { public MainPageCS () {

    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());  
    navigationPage.IconImageSource = "schedule.png";  
    navigationPage.Title = "Schedule";  
    Children.Add (new TodayPageCS ());  
    Children.Add (navigationPage);  
    
    } }

    6 objects. For more information, see .
  • Assign a collection to the property and assign a

    public class MainPageCS : TabbedPage { public MainPageCS () {

    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());  
    navigationPage.IconImageSource = "schedule.png";  
    navigationPage.Title = "Schedule";  
    Children.Add (new TodayPageCS ());  
    Children.Add (navigationPage);  
    
    } }

    8 to the property to return pages for objects in the collection. For more information, see .

With both approaches, the TabbedPage will display each page as the user selects each tab.

Important

It's recommended that a TabbedPage should be populated with

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2 and

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 instances only. This will help to ensure a consistent user experience across all platforms.

In addition, TabbedPage defines the following properties:

  • , of type

    await Navigation.PushAsync (new UpcomingAppointmentsPage ());

    6, the background color of the tab bar.
  • , of type

    await Navigation.PushAsync (new UpcomingAppointmentsPage ());

    6, the color of text on the tab bar.
  • , of type

    await Navigation.PushAsync (new UpcomingAppointmentsPage ());

    6, the color of the tab when it's selected.
  • , of type

    await Navigation.PushAsync (new UpcomingAppointmentsPage ());

    6, the color of the tab when it's unselected.

All of these properties are backed by

            
  
    
      
    
  
  
    
      
        
          
      
    
  

3 objects, which means that they can be styled, and the properties can be the targets of data bindings.

Warning

In a TabbedPage, each

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

5 object is created when the TabbedPage is constructed. This can lead to a poor user experience, particularly if the TabbedPage is the root page of the application. However, Xamarin.Forms Shell enables pages accessed through a tab bar to be created on demand, in response to navigation. For more information, see Xamarin.Forms Shell.

Populate a TabbedPage with a Page collection

A TabbedPage can be populated with a collection of child

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

5 objects, such as a collection of

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 objects. This is achieved by adding the

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

5 objects to the

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

2 collection. This is accomplished in XAML as follows:


    
    
        
            
        
    

Note

The

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

3 property of the

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

4 class, from which TabbedPage derives, is the

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

6 of

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

4. Therefore, in XAML it's not necessary to explicitly assign the

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

5 objects to the

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

3 property.

The equivalent C# code is:

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

In this example, the TabbedPage is populated with two

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

5 objects. The first child is a

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object, and the second child is a

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2 containing a

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object.

The following screenshots show a

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object in a TabbedPage:

Selecting another tab displays the

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object that represents the tab:

On the Schedule tab, the

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object is wrapped in a

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2 object.

Warning

While a

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2 can be placed in a TabbedPage, it's not recommended to place a TabbedPage into a

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2. This is because, on iOS, a `TabbedPage`4 always acts as a wrapper for the `TabbedPage`5. For more information, see Combined View Controller Interfaces in the iOS Developer Library.

Navigation can be performed within a tab, provided that the

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object is wrapped in a

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2 object. This is accomplished by invoking the `TabbedPage`8 method on the property of the

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object:

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

The page being navigated to is specified as the argument to the `TabbedPage`8 method. In this example, the `TabbedPage`2 page is pushed onto the navigation stack, where it becomes the active page:

For more information about performing navigation using the

await Navigation.PushAsync (new UpcomingAppointmentsPage ());

2 class, see Hierarchical Navigation.

Populate a TabbedPage with a template

A TabbedPage can be populated with pages by assigning a collection of data to the property, and by assigning a

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

8 to the property that templates the data as

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

5 objects. This is accomplished in XAML as follows:

            
  
    
      
    
  
  
    
      
        
          
      
    
  

The equivalent C# code is:

public class TabbedPageDemoPageCS : TabbedPage
{
  public TabbedPageDemoPageCS ()
  {
    var booleanConverter = new NonNullToBooleanConverter ();
    ItemTemplate = new DataTemplate (() =>
    {
      var nameLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
        FontAttributes = FontAttributes.Bold,
        HorizontalOptions = LayoutOptions.Center
      };
      nameLabel.SetBinding (Label.TextProperty, "Name");
      var image = new Image { WidthRequest = 200, HeightRequest = 200 };
      image.SetBinding (Image.SourceProperty, "PhotoUrl");
      var familyLabel = new Label
      {
        FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
        FontAttributes = FontAttributes.Bold
      };
      familyLabel.SetBinding (Label.TextProperty, "Family");
      ...
      var contentPage = new ContentPage
      {
        IconImageSource = "monkeyicon.png",
        Content = new StackLayout {
          Padding = new Thickness (5, 25),
          Children =
          {
            nameLabel,
            image,
            new StackLayout
            {
              Padding = new Thickness (50, 10),
              Children =
              {
                new StackLayout
                {
                  Orientation = StackOrientation.Horizontal,
                  Children =
                  {
                    new Label { Text = "Family:", HorizontalOptions = LayoutOptions.FillAndExpand },
                    familyLabel
                  }
                },
                // ...
              }
            }
          }
        }
      };
      contentPage.SetBinding (TitleProperty, "Name");
      return contentPage;
    });
    ItemsSource = MonkeyDataModel.All;
  }
}

In this example, each tab consists of a

public class MainPageCS : TabbedPage
{
  public MainPageCS ()
  {
    NavigationPage navigationPage = new NavigationPage (new SchedulePageCS ());
    navigationPage.IconImageSource = "schedule.png";
    navigationPage.Title = "Schedule";
    Children.Add (new TodayPageCS ());
    Children.Add (navigationPage);
  }
}

6 object that uses `TabbedRenderer`0 and `TabbedRenderer`1 objects to display data for the tab:

Can we add content above tabbed page in xamarin forms?

You can not add label above in tabbed page if you want to add label above tabbed page you have to crate your own tabbed page.

How do I hide the navigation bar in xamarin forms?

I simply want to hide the Navigation Bar on the pages. NavigationPage. SetHasNavigationBar(this, false);

How do I create a new page in xamarin?

To create a new page, add a new xaml file and populate it with some content..

In Solution Explorer, right-click on the project. ... .

Select Content Page from the Xamarin. ... .

You will see the new page appear in the Solution Explorer, and will be made up of both a xaml file and a xaml. ... .

Open the SecondPage..

How do I navigate from one page to another in xamarin?

The steps given below are required to be followed in order to navigate from one page to another page in Xamarin. Forms, using Visual Studio. Click File--> select New--> select Project. The project needs to be clicked after opening all the types of projects in Visual Studio or click (Ctrl+Shift+N).