[Proposal] TabView
See original GitHub issueTabView
- Proposed
- Prototype: Not Started
- Implementation: Not Started
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests: Not Started
- Sample: Not Started
- Documentation: Not Started
Summary
The TabView control allows the user to display a set of tabs and their content. The TabView is fully customizable, other than the native tab bars
Detailed Design
TabView.shared.cs
public class TabView : ContentView, IDisposable
{
public static readonly BindableProperty TabItemsSourceProperty;
public static readonly BindableProperty TabViewItemDataTemplateProperty;
public static readonly BindableProperty TabContentDataTemplateProperty;
public static readonly BindableProperty SelectedIndexProperty;
public static readonly BindableProperty TabStripPlacementProperty;
public static readonly BindableProperty TabStripBackgroundColorProperty;
public static readonly BindableProperty TabStripBackgroundViewProperty;
public static readonly BindableProperty TabStripBorderColorProperty;
public static readonly BindableProperty TabContentBackgroundColorProperty;
public static readonly BindableProperty TabStripHeightProperty;
public static readonly BindableProperty IsTabStripVisibleProperty;
public static readonly BindableProperty TabContentHeightProperty;
public static readonly BindableProperty TabIndicatorColorProperty;
public static readonly BindableProperty TabIndicatorHeightProperty;
public static readonly BindableProperty TabIndicatorWidthProperty;
public static readonly BindableProperty TabIndicatorViewProperty;
public static readonly BindableProperty TabIndicatorPlacementProperty;
public static readonly BindableProperty IsTabTransitionEnabledProperty;
public static readonly BindableProperty IsSwipeEnabledProperty;
public ObservableCollection<TabViewItem> TabItems { get; }
public IList? TabItemsSource { get; set; }
public DataTemplate? TabViewItemDataTemplate { get; set; }
public DataTemplate? TabContentDataTemplate { get; set; }
public int SelectedIndex { get; set; }
public TabStripPlacement TabStripPlacement { get; set; }
public Color TabStripBackgroundColor { get; set; }
public View? TabStripBackgroundView { get; set; }
public Color TabStripBorderColor { get; set; }
public Color TabContentBackgroundColor { get; set; }
public double TabStripHeight { get; set; }
public bool IsTabStripVisible { get; set; }
public double TabContentHeight { get; set; }
public Color TabIndicatorColor { get; set; }
public double TabIndicatorHeight { get; set; }
public double TabIndicatorWidth { get; set; }
public View? TabIndicatorView { get; set; }
public TabIndicatorPlacement TabIndicatorPlacement { get; set; }
public bool IsTabTransitionEnabled { get; set; }
public bool IsSwipeEnabled { get; set; }
public event TabSelectionChangedEventHandler? SelectionChanged;
public event TabViewScrolledEventHandler? Scrolled;
public void Dispose();
}
Usage Syntax
XAML Usage
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="MyLittleApp.MainPage">
<Grid>
<xct:TabView
TabStripPlacement="Bottom"
TabStripBackgroundColor="Blue"
TabStripHeight="60"
TabIndicatorColor="Yellow"
TabContentBackgroundColor="Yellow">
<xct:TabViewItem
Icon="triangle.png"
Text="Tab 1"
TextColor="White"
TextColorSelected="Yellow"
FontSize="12">
<Grid
BackgroundColor="Gray">
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent1" />
</Grid>
</xct:TabViewItem>
<xct:TabViewItem
Icon="circle.png"
Text="Tab 2"
TextColor="White"
TextColorSelected="Yellow"
FontSize="12">
<Grid>
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent2" />
</Grid>
</xct:TabViewItem>
</xct:TabView>
</Grid>
</ContentPage>
C# Usage
Content = new Grid
{
new TabVIew
{
TabItems =
{
new TabItem
{
Icon = "circle.png",
Text = "Tab 2",
TextColor = Colors.White,
TextColorSelected = Colors.Yellow,
FontSize = 12
View = new Label { Text = "TabContent2" }.Center()
}
}
}
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:29
- Comments:33 (4 by maintainers)
Top Results From Across the Web
Proposal: Add `TabDisplayMode` for `TabView` · Issue #7202
So please add a property TabDisplayMode for TabView class to allow to do so. Its type is an Enum with following values.
Read more >Proposal: Placement of a TabView · Issue #2838
For me as a visual concept, there is no difference between TabView and TabControl because they share the same subject: render elements in...
Read more >Forum:(Proposal) Page Tab View Articles
Forums: Index > (Proposal) Page Tab View Articles. This thread is just a suggestion. I think, rather than using template:Parent Tab for as...
Read more >Proposal for bookmarkable URLs creation facility for tabview
I have a proposal for tabview to add a facility to create bookmarkable URLs for the each tab, out of the box. It...
Read more >Manipulate, TabView, and Histograms. Can they all be ...
Is it possible to add another layer to the TabView to allow the combination of data sets (say I want Proposal 1 and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brminnick Sorry about going totally MIA! Life ended up throwing some major personal things my way. Long story short I wasn’t able to get access to a computer for the last 5 months or so. That being said, I will begin work again on the implementation for this proposal!
@ewerspej it would be easier to make shell looks like TabView rather then integrating navigation. Here is an example how you can customize shell appearance: https://vladislavantonyuk.github.io/articles/Customizing-.NET-MAUI-Shell