白色圆角图片

bg_round_rectangle_white.xml

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle">        <solid android:color="#FFFFFF" />        <corners        android:radius="2dp"/>        <stroke        android:width="1dp"        android:color="#D5D5D5"/>shape>

白色圆角虚线框

bg_round_rectangle_white_dash.xml

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle">        <solid android:color="#FFFFFF" />        <corners        android:radius="2dp"/>        <stroke        android:width="1dp"        android:color="#DD4041"        android:dashWidth="1dp"        android:dashGap="2dp"/>shape>

红色圆角图片

bg_round_rectangle_red.xml

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle">        <solid android:color="#F15C5D" />        <corners        android:radius="2dp"/>        <stroke        android:width="1dp"        android:color="#D42D2E"/>shape>

绿色圆角图片

bg_round_rectangle_green.xml

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle">        <solid android:color="#88C14E" />        <corners        android:radius="2dp"/>        <stroke        android:width="1dp"        android:color="#6FA13C"/>shape>

正三角形图片

triangle_white_arrow_up.xml

<?xml version="1.0" encoding="utf-8"?><rotate xmlns:android="http://schemas.android.com/apk/res/android"    android:fromDegrees="45"    android:toDegrees="45"    android:pivotX="-40%"    android:pivotY="80%">    <shape android:shape="rectangle">        <solid android:color="#000000"/>    shape>rotate>

倒立正三角形图片

triangle_white_arrow_down.xml

<?xml version="1.0" encoding="utf-8"?><rotate xmlns:android="http://schemas.android.com/apk/res/android"    android:fromDegrees="45"    android:toDegrees="45"    android:pivotX="135%"    android:pivotY="15%">    <shape android:shape="rectangle">        <solid android:color="#000000"/>    shape>rotate>

实际效果

Android使用xml自定义图片_第1张图片

更多相关文章

  1. android 获取图片
  2. android 读取,写入图片到sd卡源码
  3. Android 图片缩放
  4. Android 取出 图片以字节形式存放到数据库的数据,并将图片显示
  5. android图片闪烁或帧动画
  6. ImageButton动态改变按钮图片
  7. Android使用AsyncTask下载显示图片

随机推荐

  1. Android之插件化框架RePlugin——献给And
  2. 一次搞定Process和Task
  3. Android8.0 存储系统
  4. Android打造属于自己的数据库操作类。
  5. Android自定义控件系列九:从源码看Android
  6. Android(安卓)JSON:Gson,FastJson解析库的
  7. 在 Android(安卓)手机上运行 Node.js 应
  8. Android(安卓)创建与解析XML(一)---- SAX方
  9. Android:触摸移动的悬浮窗口
  10. Android线程模型(Painless Threading) ---