Giter Club home page Giter Club logo

stabbedpage.forms's Introduction

STabbedPage.Forms

Full customizable TabbedPage control for Xamarin.Forms.

NuGet

Supports Android and iOS.

Screen-Shots

STabbedPage for Android STabbedPage for iOS

Setup

  • Install the nuget package in portable and all platform specific projects.

Android

In MainActivity.cs file

    Stormlion.STabbedPage.Droid.Platform.Init(this);

iOS

In AppDelegate.cs file

    Stormlion.STabbedPage.iOS.Platform.Init();

Usage

	<?xml version="1.0" encoding="utf-8" ?>
	<stab:STabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
			  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
			  xmlns:stab="clr-namespace:Stormlion.STabbedPage;assembly=Stormlion.STabbedPage"
			  Title="Customizable TabbedPage"
			  x:Class="Test.TabbedPage1"
			  TabBarPosition="Top"
			  TopBarHeight="0"
			  >
		
		<!-- Cell Template -->
		<stab:STabbedPage.TabBarCellTemplate>
			<DataTemplate>
				<Grid BackgroundColor="White">
					<Label Text="{Binding Title}"
     	 				       HorizontalTextAlignment="Center"
					       VerticalTextAlignment="Center"
					       />
				</Grid>
			</DataTemplate>
		</stab:STabbedPage.TabBarCellTemplate>
		
		<!-- Selected Cell Template -->
		<stab:STabbedPage.TabBarSelectedCellTemplate>
			<DataTemplate>
				<Grid BackgroundColor="Orange">
					<Label Text="{Binding Title}"
					       HorizontalTextAlignment="Center"
					       VerticalTextAlignment="Center"
					       TextColor="White"
					       />
				</Grid>
			</DataTemplate>
		</stab:STabbedPage.TabBarSelectedCellTemplate>
		
		<!-- Pages -->
		<ContentPage Title="Tab 1"
			     BackgroundColor="Yellow"
			     >
			<ContentPage.Content>
				<StackLayout>
					<Label Text="Page 1"
					       VerticalOptions="CenterAndExpand" 
					       HorizontalOptions="CenterAndExpand"
					       />
				</StackLayout>
			</ContentPage.Content>
		</ContentPage>
		<ContentPage Title="Tab 2"
			     BackgroundColor="LightGreen"
			     >
			<ContentPage.Content>
				<StackLayout>
					<Label Text="Page 2"
					       VerticalOptions="CenterAndExpand" 
					       HorizontalOptions="CenterAndExpand"
					       />
				</StackLayout>
			</ContentPage.Content>
		</ContentPage>
		<ContentPage Title="Tab 3"
			     BackgroundColor="LightBlue"
			     >
			<ContentPage.Content>
				<StackLayout>
					<Label Text="Page 3"
					       VerticalOptions="CenterAndExpand" 
					       HorizontalOptions="CenterAndExpand"
					       />
				</StackLayout>
			</ContentPage.Content>
		</ContentPage>
	</stab:STabbedPage>

Properties

  • TabBarPosition ( Top or Bottom )
  • TabBarCellTemplate
  • TabBarSelectedCellTemplate
  • TabBarHeight
  • SplitterColor and SplitterWidth
  • TopBarColor and TopBarHeight
  • BottomBarColor and BottomBarHeight

Contributions

Contributions are welcome!

stabbedpage.forms's People

Contributors

stormlion227 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

stabbedpage.forms's Issues

Nice but issues

Hi first of all great effort i can easily customize the tab items.
I am facing one major problem i hope you would have an idea what iam missing.
I have login page and after successful login Mainpage would appear which is STabbedPage contains 4 tabs .
Problem is i have nested navigation inside the child page of STabbedPage but when i click new page load and STabbedPage pulled back but in normal usage of Tab-page is nest navigation does load the page in totally new window it appears inside the same master page.
Please guide me what are the settings are required to achieve the desired result.

Regards

ATIF

Custom TabBarCellTemplate not working

Hi @stormlion227,

To provide Icon and Badge for a given TabBarCell, I provided following DataTemplate. But instead of seeing an icon and a badge text on the row 0 of the cell and the label Tab 2 on the row 1, I am seeing the output displayed as shown in the screenshot below.
Can you please help me fix this ?

You could also look my previous GitHub issue that can explain my end goal as well.

<stab:STabbedPage.TabBarCellTemplate>
    <DataTemplate>
        <Grid BackgroundColor="PaleVioletRed"
            ColumnSpacing="5">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="20"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Label Text="Icon"
                Grid.Row="0" 
                Grid.Column="0"
                HorizontalOptions="EndAndExpand"
                VerticalOptions="EndAndExpand"
 	 			HorizontalTextAlignment="Center"
				VerticalTextAlignment="Center"
				/>
            <Label Text="Badge"
                Grid.Row="0" 
                Grid.Column="1"
                HorizontalOptions="StartAndExpand"
                VerticalOptions="EndAndExpand"                       
 	 			HorizontalTextAlignment="Center"
				VerticalTextAlignment="Center"
				/>
            <Label Text="{Binding Title}"
                Grid.Row="1" 
                Grid.ColumnSpan="2"
                HorizontalOptions="Center"
                VerticalOptions="Center"                       
 	 			HorizontalTextAlignment="Center"
				VerticalTextAlignment="Center"
				/>
        </Grid>
    </DataTemplate>
</stab:STabbedPage.TabBarCellTemplate>

image

In CS page

Hi stormlion227,

How can we do this in .cs as currently its in xaml page. Can you please share an example if possible. I tried to do it in .cs page similar to xaml but couldn't.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.