<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:background="@drawable/good_list_bg"
    android:orientation="horizontal" >    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/foot_bg"
        android:gravity="center" >        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="0.25" >            <ImageView
                android:id="@+id/toolbar_tabonebg"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="@drawable/footer_active_bg"
                android:visibility="visible" />            <ImageView
                android:id="@+id/toolbar_tabone"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:background="#00000000"
                android:padding="7dp"
                android:src="@drawable/footer_home_icon" />
        </FrameLayout>        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="0.25" >            <ImageView
                android:id="@+id/toolbar_tabtwobg"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="@drawable/footer_active_bg"
                android:visibility="invisible" />            <ImageView
                android:id="@+id/toolbar_tabtwo"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:background="#00000000"
                android:padding="7dp"
                android:src="@drawable/footer_search_icon" />
        </FrameLayout>        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="0.25" >            <ImageView
                android:id="@+id/toolbar_tabthreebg"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="@drawable/footer_active_bg"
                android:visibility="invisible" />            <ImageView
                android:id="@+id/toolbar_tabthree"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:background="#00000000"
                android:padding="7dp"
                android:src="@drawable/footer_shopping_cart_icon" />            <LinearLayout
                android:id="@+id/shopping_cart_num_bg"
                android:layout_width="15dp"
                android:layout_height="15dp"
                android:layout_gravity="center_horizontal"
                android:layout_marginLeft="15dp"
                android:layout_marginTop="3dp"
                android:background="@drawable/search_new_shopping_cart_num_bg"
                android:gravity="center"
                android:orientation="vertical" >                <TextView
                    android:id="@+id/shopping_cart_num"
                    android:layout_width="15dp"
                    android:layout_height="15dp"
                    android:layout_marginBottom="2dp"
                    android:gravity="center"
                    android:text="0"
                    android:textColor="#ffffff"
                    android:textSize="10dp" />
            </LinearLayout>
        </FrameLayout>
        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="0.25" >            <ImageView
                android:id="@+id/toolbar_tabfourbg"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="@drawable/footer_active_bg"
                android:visibility="invisible" />            <ImageView
                android:id="@+id/toolbar_tabfour"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:background="#00000000"
                android:padding="7dp"
                android:src="@drawable/footer_user_icon" />
        </FrameLayout>
    </LinearLayout></LinearLayout>

解决方案 »

  1.   

    这种github上有开源的,别人封装好了。https://github.com/jgilfelt/android-viewbadger各种齐全的效果。
      

  2.   

    我知道楼主是想在桌面上实现应用icon上的数字,要是应用内就简单了,也不会来问了。
    我觉得这个在安卓上没法实现,只有系统自带的才有。要不然,微信这种在ios上实现了这种效果,为何android上没有
      

  3.   

    这个是系统功能,同一个软件在miui上有这样的提示,在原生安卓上没有
      

  4.   

    这个是系统功能,同一个软件在miui上有这样的提示,在原生安卓上没有因为这个应用商店是 小米的,所以它可以显示
      

  5.   

    http://www.eoeandroid.com/thread-191571-1-1.html
    可以参考这个,将浮动插件浮动到icon右上角的位置。
      

  6.   

    android的应该不太好实现吧!否则ios上那么流行,android不可能不拿过来用的!
      

  7.   

    按经验做个假设哈,记得经常在开机时候读SD卡没那么快,图标都是没有的,一段时间后就出现了,这个图标控制是动态的,而且大概就在安装的目录下维护的,写个sevice来修改该图标试试?在window开发下,桌面图标毫无疑问,只是一个快捷方式,而且图片还是可以修改的,相对这个也是类似的吧。。
      

  8.   

    我觉得使用Android widget是一个思路,安装程序时不显示图标,而是在桌面上安装一个1x1大小的widget效果和图标一样,GO短信就是这样做的。