Xamarin Platform Specifics

2018-07-29 17_18_45-android mustache - Google Search.pngThere are many ways to customize a Xamarin app for a specific platform. One of the easiest is a tool called, “Platform Specifics”. These are tools the Xamarin Forms team has baked into Xamarin which are super popular.

In this example, we’ll use an Android Platform Specific to color and push a Tabbed Page to the bottom of the page.

Once we add the namespace for AndroidSpecifics, we simply reference the ToobarPlacement and other Android specific fields.

<?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:DeltMeForms"
            xmlns:a="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
            BarBackgroundColor="#ff00FF00"
            x:Class="DeltMeForms.MainPage" 
            a:TabbedPage.BarSelectedItemColor="#ff000000"
            a:TabbedPage.BarItemColor="#33FF00FF" 
            a:TabbedPage.ToolbarPlacement="Bottom">
 
    <TabbedPage.Children>
        <NavigationPage Title="Hi">
            <x:Arguments>
                <local:Page1> </local:Page1>
            </x:Arguments>
        </NavigationPage>
    </TabbedPage.Children>
 
</TabbedPage>
 
 
 

 

Advertisements