Xamarin Forms now implements the ability to create tab layouts. This package still works well if you want a more customized tab ayout.
TabsPage
in the examples for implementation.https://www.nuget.org/packages/Plugin.ProXamTabs
All properties are bindable.
xmlns:pxTabs="clr-namespace:Plugin.ProXamTabs.Shared;assembly=Plugin.ProXamTabs""
.IsTabBarOnTop
:
<pxTabs:PXTabsView
x:Name="tabsView"
BorderColor="Teal"
SliderColor="Teal"
IsBorderOnBottom="False"
IsBorderVisible="True"
IsSliderOnBottom="False"
IsSliderVisible="True"
IsTabBarOnTop="False"/>
PXTab
s and and them to the tab view: tabsView.Tabs = [YourListOfTabs];
, or bind the list directly. The PXTab
is fully customisable:
new PXTab()
{
TabId = 1,
TabView = new HomeView(),
Text = "Home",
SelectedImage = "tab_home",
UnselectedImage = "tab_home_gray",
SelectedColor = Color.Gray,
UnSelectedColor = Color.Black,
TextSize = 12,
ImageSize = 24,
BadgeCount = 3,
BadgeColor = Color.Blue
};
TabView
property of a PXTab
will be the view that will be shown when the tab is selected.If you do not want the PXTabsView
to handle the switching of the views, you can simply use the PXTabsLayout
which will give you the tab bar that you can place anywhere in your view. Use the Command<PXTab> TabSelectedCommand
property to detect the change in tab selection.