【问题标题】:Xamarin Forms ToolBarItem (Number over the Icon) NotificationXamarin Forms ToolBarItem(图标上的数字)通知
【发布时间】:2015-05-21 05:26:51
【问题描述】:

我希望使用 Xamarin Forms 共享项目显示如下图所示的通知。有没有办法在工具栏项目的图标上添加文本/数字?

Follow this link to view example since i cant post images.

【问题讨论】:

    标签: android ios notifications xamarin xamarin.forms


    【解决方案1】:

    目前,这在 Xamarin Forms (v1.4) 中是不可能的。但是,您可以在 iOS 和 Android 项目中创建一个自定义渲染器来解决问题。

    这篇文章可能对你有所帮助:Creating a Cross-Platform Application Bar for Xamarin

    在 TabBarItem(适用于 iOS)上,可以设置 BadgeValue,这可能是您正在寻找的。 ToolBarItem 上不存在此属性。

    另一种更丑陋的解决方案是添加具有不同编号的图像,然后在您的视图模型中选择合适的图像。

    【讨论】:

      猜你喜欢
      • 2020-05-22
      • 1970-01-01
      • 2018-07-21
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多