【问题标题】:Android Button Notifications like messages buttonAndroid Button Notifications like messages 按钮
【发布时间】:2014-03-06 04:25:26
【问题描述】:

有没有人知道消息按钮如何在顶部角落通知和更新我们有多少未读消息以及您是如何做到的。在此先感谢这是我想要的示例图片,

这是一个用于 android 中按钮的常用 xml 代码示例,

 <Button
        android:id="@+id/bAddRec"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center"
        android:text="@string/add" />

我希望你的回答也对其他人有用:)

【问题讨论】:

  • No men 这在 Android 中是不可能的,但您可以在 Android 中使用AppWidget 来实现这种类型的功能。
  • 您想在应用内或应用抽屉中的应用图标上执行此操作?
  • 您必须使用具有按钮和图像视图的 Framelayout。根据通知使imageview可见。
  • @Manish Dubey 我只想了解应用程序和应用程序图标 :) 如果可能,请提供更多解决方案 :)
  • @Gaurav Berry 感谢您提供的信息,我为这项任务找到了一些想法:)

标签: android android-layout android-notifications android-button


【解决方案1】:

看看这个 ViewBager lib..它会帮助你

在此 yourView 被放置在 framelayout 中,右上角的角徽章表示未读的消息或计数或任何东西....

ViewBager liberary

【讨论】:

  • 非常感谢您的链接非常有用,希望我能快速学习并在我的应用程序中实现它们:)
【解决方案2】:

Android 不支持这种做法,因为它有用于这种目的的通知栏。但如果你真的很需要它,三星和索尼 Xperia 为你提供了一种方法。

这可能对您有帮助: How to display count of notifications in app launcher icon

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多