Platform-specific behaviour

Other topics

Remarks:

Target Platforms

if(Device.OS == TargetPlatform.Android)
{

}
else if (Device.OS == TargetPlatform.iOS)
{

}
else if (Device.OS == TargetPlatform.WinPhone)
{

}
else if (Device.OS == TargetPlatform.Windows)
{

}
else if (Device.OS == TargetPlatform.Other)
{

}

Removing icon in navigation header in Anroid

enter image description here Using a small transparent image called empty.png

public class MyPage : ContentPage
{
    public Page()
    {
        if (Device.OS == TargetPlatform.Android)
            NavigationPage.SetTitleIcon(this, "empty.png");
    }
}

Make label's font size smaller in iOS

Label label = new Label
{
    Text = "text"
};
if(Device.OS == TargetPlatform.iOS)
{
    label.FontSize = label.FontSize - 2;
}

Contributors

Topic Id: 6636

Example Ids: 22610,22611

This site is not affiliated with any of the contributors.