A5下载文章资讯

分类分类

android图片上显示气泡消息

2015-07-08 11:53作者:zhao

经常需要在一个图片上面显示一个气泡,在气泡上面显示消息的数量。这里提供一种方法,直接设置textview的背景色,并且设置textview的文本信息。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:background="@drawable/ic_launcher"

tools:context=".MainActivity" >

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="right|bottom"

android:layout_marginLeft="40dip"

android:background="@drawable/red_circle"

android:gravity="center"

android:text="1"

android:textSize="12dip" />

</LinearLayout>

实现效果:

 

展开全部

相关

说两句网友评论
    我要跟贴
    取消