Android按钮通知,如消息按钮

时间:2014-03-06 04:25:27

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

有没有人知道消息按钮的方式,通知并在顶部更新我们有多少未读消息,以及如何做到这一点。在此先感谢这是我想要的样本图片,

enter image description here

这是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" />

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

2 个答案:

答案 0 :(得分:1)

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

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

答案 1 :(得分:1)

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

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

ViewBager liberary