怎么做QQ、微信等消息气泡

主XML:

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="wrap_content"
 4     android:layout_height="wrap_content" >
 5 
 6     <ImageView
 7         android:layout_width="wrap_content"
 8         android:layout_height="wrap_content"
 9         android:layout_margin="10dp"
10         android:background="@drawable/round"
11         android:src="@drawable/ic_launcher" />
12 
13     <TextView
14         android:layout_width="wrap_content"
15         android:layout_height="wrap_content"
16         android:layout_gravity="right"
17         android:layout_margin="3dp"
18         android:background="@drawable/smallyuan"
19         android:text="10"
20         android:textColor="@android:color/white" />
21 
22 </FrameLayout>

橘黄色的圆圈:

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <shape xmlns:android="http://schemas.android.com/apk/res/android" 
 3     android:shape="oval"
 4     android:useLevel="false">
 5     
 6     <!-- 背景填充颜色值 -->
 7     <solid android:color="#FFA500" />
 8 
 9     <!-- radius值越大,越趋于圆形 -->
10     <corners android:radius="20dip" />
11 
12     <!-- 圆角图像内部填充四周的大小 ,将会以此挤压内部布置的view -->
13     <padding
14         android:bottom="3dip"
15         android:left="3dip"
16         android:right="3dip"
17         android:top="3dip" />
18 
19 </shape>

上方气泡圆圈:

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <shape xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:shape="oval"
 4     android:useLevel="false" >
 5 
 6     <!-- 背景填充颜色值 -->
 7     <solid android:color="#FF0000" />
 8 
 9     <!-- radius值越大,越趋于圆形 -->
10     <corners android:radius="20dip" />
11 
12     <!-- 圆角图像内部填充四周的大小 ,将会以此挤压内部布置的view -->
13     <padding
14         android:bottom="3dip"
15         android:left="3dip"
16         android:right="3dip"
17         android:top="3dip" />
18 
19 </shape>

 

转载于:https://www.cnblogs.com/zzw1994/p/4950706.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值