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>
  • 相关阅读:
    第八节:layout和partialView、RenderPartial和Partial、 action和RenderAction
    第七节:HtmlHelper及其扩展
    第六节:Razor引擎及相关语法
    第五节:从源码的角度理解各种Result(ActionResult、JsonResult、JavaScriptResult等)
    图片保存到数据库以及C#读取图片
    C#复制数据到剪切板
    IIS8.5支持WCF
    C# 中const和readonly的区别
    C#获取类库(DLL)的绝对路径
    C#怎样用文件读写在文件的原有基础上追加一行数据
  • 原文地址:https://www.cnblogs.com/zzw1994/p/4950706.html
Copyright © 2011-2022 走看看