Skip to content

Platform-specific behaviour

Removing icon in navigation header in Anroid

Section titled “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");
}
}
Label label = new Label
{
Text = "text"
};
if(Device.OS == TargetPlatform.iOS)
{
label.FontSize = label.FontSize - 2;
}

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)
{
}