1. Tag Results
fonticon-tabview (2)
1 - 2 of 2
How to customize the tab item in .NET MAUI Tab View?
Overview Enhance the user interface in .NET MAUI Tab View by adding font icons to the TabItems along with header text. This is achieved by using the FontImageSource element within your XAML code. Below is a step-by-step guide on how to customize your TabItems with font icons. Adding Font Icons to TabItems To add font icons to your TabItems, use the FontImageSource element within each SfTabItem. Here’s an example of how to do this: <tabView:SfTabView x:Name="tabView" TabBarBackground="HotPink"> <tabView:SfTabView.Items> <!-- TabItem with a Call icon --> <tabView:SfTabItem Header="Call" x:Name="callItem" ImagePosition="Left"> <tabView:SfTabItem.ImageSource> <FontImageSource Glyph="ﺶ" x:Name="call" Color="{Binding Source={x:Reference callItem},Path=TextColor}" FontFamily="MaterialDesignIcons"/> </tabView:SfTabItem.ImageSource> <!-- Content for the Call tab --> <!-- ... --> </tabView:SfTabItem> <!-- TabItem with a Favourite icon --> <tabView:SfTabItem Header="Favourite" x:Name="favItem" ImagePosition="Left"> <tabView:SfTabItem.ImageSource> <FontImageSource Glyph="" x:Name="fav" Color="{Binding Source={x:Reference favItem},Path=TextColor}" FontFamily="MaterialDesignIcons"/> </tabView:SfTabItem.ImageSource> <!-- Content for the Favourite tab --> <!-- ... --> </tabView:SfTabItem> <!-- TabItem with a Contacts icon --> <tabView:SfTabItem Header="Contacts" x:Name="contactsItem" ImagePosition="Left"> <tabView:SfTabItem.ImageSource> <FontImageSource Glyph="" x:Name="contacts" Color="{Binding Source={x:Reference contactsItem},Path=TextColor}" FontFamily="MaterialDesignIcons"/> </tabView:SfTabItem.ImageSource> <!-- Content for the Contacts tab --> <!-- ... --> </tabView:SfTabItem> </tabView:SfTabView.Items> </tabView:SfTabView> In the above example, each SfTabItem has an ImageSource defined with a FontImageSource. The Glyph attribute is used to specify the icon, and the Color attribute is bound to the TextColor of the tab item, ensuring that the icon color matches the text color. The FontFamily should be set to the font that contains your icons, such as “MaterialDesignIcons” in this case. Binding the Icon Color To ensure that the icon color matches the text color of the tab, bind the icon color to the TextColor property of the SfTabItem using the syntax {Binding Source={x:Reference NameOfTabItem}, Path=TextColor}. Output Note: Remember to include the font file containing your icons in your project and set the appropriate build action for it. This will ensure that the icons are displayed correctly in your application. Download the complete sample from GitHub Conclusion I hope you enjoyed learning how to customize the tab item in .NET MAUI Tab View. You can refer to our .NET MAUI Tab View feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI Tab View documentation to understand how to present and manipulate data. You can check out our .NET MAUI components from the License and Downloads page for current customers. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Tab View and other .NET MAUI components. Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
How to create a Tab View using custom font icon in .NET MAUI (SfTabView)?
In .NET MAUI, creating a Tab View with custom font icons can enhance the visual appeal and user experience of your application. This article will guide you through the process of implementing a .NET MAUI TabView using custom Font Icons in your application. Step 1: Define the Tab View in XAML: In your XAML file, define the Tab View and include SfTabItem elements with the Header property set to the Unicode character of the icon, and the FontFamily set to the name of your custom font. XAML <tabView:SfTabView x:Name="tabView" TabWidthMode="Default" TabBarHeight="100" > <tabView:SfTabView.Items > <tabView:SfTabItem Header="" FontFamily="SegmentIcon" FontSize="25"> <tabView:SfTabItem.Content> <Label Text="Calls items"></Label> </tabView:SfTabItem.Content> </tabView:SfTabItem> <tabView:SfTabItem Header="" FontFamily="SegmentIcon" FontSize="25" > <tabView:SfTabItem.Content> <Label Text="Favourite items"></Label> </tabView:SfTabItem.Content> </tabView:SfTabItem> <tabView:SfTabItem Header="" FontFamily="SegmentIcon" FontSize="25"> <tabView:SfTabItem.Content> <Label Text="Message items"></Label> </tabView:SfTabItem.Content> </tabView:SfTabItem> </tabView:SfTabView.Items> </tabView:SfTabView> Output Conclusion I hope you enjoyed learning how to create a Tab View using custom font icons in .NET MAUI. You can refer to our .NET MAUI Tab View feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI Tab View documentation to understand how to present and manipulate data. You can check out our .NET MAUI components from the License and Downloads page for current customers. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Tab View and other .NET MAUI components. Please let us know in the comments section if you have any queries or require clarification. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
No articles found
No articles found
1 of 1 pages (2 items)