Xamarin Forms now implements the ability to create tab layouts. This package still works well if you want a more customized tab ayout.
- A tab layout that is more customizable and easier to use than trying to implement the native layouts.
- Written entirely in Forms with no native code.
- Check out the
TabsPage
in the examples for implementation.
https://www.nuget.org/packages/Plugin.ProXamTabs
All properties are bindable.
- If implementing in Xaml, add the namespace
xmlns:pxTabs="clr-namespace:Plugin.ProXamTabs.Shared;assembly=Plugin.ProXamTabs""
. - Add the view to your page, set the tab bar on top or bottom by setting
IsTabBarOnTop
:
<pxTabs:PXTabsView
x:Name="tabsView"
BorderColor="Teal"
SliderColor="Teal"
IsBorderOnBottom="False"
IsBorderVisible="True"
IsSliderOnBottom="False"
IsSliderVisible="True"
IsTabBarOnTop="False"/>
- Create a list of
PXTab
s and and them to the tab view:tabsView.Tabs = [YourListOfTabs];
, or bind the list directly. ThePXTab
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
};
- Setting the
TabView
property of aPXTab
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.