zoukankan      html  css  js  c++  java
  • 怎么做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>
  • 相关阅读:
    怎样在过滤器中读取配置信息?
    怎样将直接数据库中Json字段,映射到Mybatis中的Map类型?
    spring/boot 打包,资源/配置/业务文件分离
    使用VS Code推送代码到GitHub
    Clion下jni配置
    curl post请求总是返回417错误
    ubuntu 12.10 apt-get 源
    如何让git小乌龟工具TortoiseGit记住你的账号密码
    FastCgi与Cgi
    Libevent核心原理
  • 原文地址:https://www.cnblogs.com/zzw1994/p/4950706.html
Copyright © 2011-2022 走看看