在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):xabre/xamarin-forms-tab-badge开源软件地址(OpenSource Url):https://github.com/xabre/xamarin-forms-tab-badge开源编程语言(OpenSource Language):C# 94.9%开源软件介绍(OpenSource Introduction):xamarin-forms-tab-badgeXamarin Forms bindable tab badges for iOS, Android, UWP, MacOS and WPF. The plugin creates a custom renderer (for each platform) and a custom attached property for adding tab bar badges which can be bound in XF shared code. SampleSupport & Limitations
*(1) Min Android API level 15, bottom placement also supported starting with v2.1.0 *(2) Min UWP version: Win 10 Fall Creators Update (XF.3 has a .netstandard 2 requirement). *(3) MacOS version: - *(4) WPF version: - **Font restrictions: able to bind font attributes and family but not size Installation
iOS, Android, UWP, MacOS, WPFYou have to register the custom renderer. I usually put this in the AssemblyInfo.cs file of my Platform specific project (iOS, Android, UWP, MacOS, WPF) csproj.
Caution: If you are using the NON AppCompat MainActivity (i.e. you Main activity inherits from FormsApplicationActivity) please register the 'Legacy' renderer
Caution - Custom TabbedPage / Custom RenderersIf you are using a custom renderer for TabbedPage please change it to inherit from LinkerAs you already know when you enable linkling for your application the linker might remove some of the methods/types/properties/events used by third party libraries. This is why it's necessary to update your
UsageBadge TextFor each child page of the TabbedPage just bind the custom attached property
[ XAMLThe important line here is binding the attached property:
Example tabbed page with badged children:
CSharp codebehind
Badge ColorVery similar to Badge Text ColorVery similar to Badge Font AttributesVery similar to ToDo:
Badge PositionVery similar to
Showning / Hiding the badgeIf the value of the Generic Badge ViewAs of v2.2.0 the package also contains a XF Badge view that is based on a XF Frame View and can be added to any layout and bound using the usual approach. The generic badge view can also be added to custom NavigationPage.TitleView layouts. Checkout the Sample-App for more. Licence |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论