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>
  • 相关阅读:
    zhanwei
    站位
    Web前端开发:SQL Jsp小项目(二)------添加修改
    Web前端开发:SQL Jsp小项目(一)
    JDBC(用Eclipse操作数据库Oracle)的基础操作集合
    Thread多线程stopSleep顺序问题
    IO流详解之代码详解
    IO流详解(半教材类型)
    用JQuery编写textarea,input,checkbox,select
    Java编写ArrayBasic制作一个简单的酒店管理系统
  • 原文地址:https://www.cnblogs.com/zzw1994/p/4950706.html
Copyright © 2011-2022 走看看