1、基本圆角、边框


  1. <?xml version="1.0" encoding="utf-8"?>
  2. <shape xmlns:android="http://schemas.android.com/apk/res/android" >
  3. <!-- 填充 -->
  4. <solid android:color="#ff9d77" /> <!-- 定义填充的颜色值 -->
  5. <!-- 描边 -->
  6. <stroke
  7. android:width="2dp"
  8. android:color="#fad3cf" /> <!-- 定义描边的宽度和描边的颜色值 -->
  9. <!-- 圆角 -->
  10. <corners
  11. android:bottomLeftRadius="5dp"
  12. android:bottomRightRadius="5dp"
  13. android:topLeftRadius="5dp"
  14. android:topRightRadius="5dp" /> <!-- 设置四个角的半径 -->
  15. <!-- 间隔 -->
  16. <padding
  17. android:bottom="10dp"
  18. android:left="10dp"
  19. android:right="10dp"
  20. android:top="10dp" /> <!-- 设置各个方向的间隔 -->
  21. </shape>
2、自由边框 (左上下有描边,右边无描边)
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 描边左上下边框 -->
<item>
<shape>
<stroke
android:width="1dp"
android:color="#FF6600" />
<!-- 圆角 -->
<corners
android:bottomLeftRadius="3dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="3dp"
android:topRightRadius="0dp" />
</shape>
</item> <!-- 主体背景 -->
<item
android:bottom="2dp"
android:left="2dp"
android:top="2dp">
<shape android:shape="rectangle" >
<!-- 填充 -->
<solid android:color="#FFFFFF" />
<!-- 设置各个方向的间隔 -->
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
</shape>
</item>
</layer-list>




android图片绘制的更多相关文章

  1. Android中绘制圆角矩形图片及任意形状图片

    圆角矩形图片在苹果的产品中很流行,相比于普通的矩形,很多人都喜欢圆角矩形的图片,因为它避开了直角的生硬,带来更好的用户体验,下面是几个设计的例子: 下面在Android中实现将普通的矩形图片绘制成圆角 ...

  2. Android UI 绘制过程浅析(五)自定义View

    前言 这已经是Android UI 绘制过程浅析系列文章的第五篇了,不出意外的话也是最后一篇.再次声明一下,这一系列文章,是我在拜读了csdn大牛郭霖的博客文章<带你一步步深入了解View> ...

  3. android图片处理方法

    Java代码 //压缩图片大小 public static Bitmap compressImage(Bitmap image) { ByteArrayOutputStream baos = new ...

  4. fackbook的Fresco (FaceBook推出的Android图片加载库-Fresco)

    [Android开发经验]FaceBook推出的Android图片加载库-Fresco   欢迎关注ndroid-tech-frontier开源项目,定期翻译国外Android优质的技术.开源库.软件 ...

  5. android图片处理方法(不断收集中)

    //压缩图片大小 public static Bitmap compressImage(Bitmap image) { ByteArrayOutputStream baos = new ByteArr ...

  6. Android 图片处理方法

    //压缩图片大小 public static Bitmap compressImage(Bitmap image) { ByteArrayOutputStream baos = new ByteArr ...

  7. android图片处理方法(转)

    //压缩图片大小 public static Bitmap compressImage(Bitmap image) { ByteArrayOutputStream baos = new ByteArr ...

  8. 【转】Android Shape绘制虚线在手机端查看是实线的问题

    Android share绘制虚线在手机上显示实线问题 给控件添加Drawableleft等图片后,单独给图片设置动画效果,参考文章: http://blog.csdn.net/langzxz/art ...

  9. Android图片加载框架最全解析(五),Glide强大的图片变换功能

    大家好,又到了学习Glide的时间了.前段时间由于项目开发紧张,再加上后来又生病了,所以停更了一个月,不过现在终于又可以恢复正常更新了.今天是这个系列的第五篇文章,在前面四篇文章的当中,我们已经学习了 ...

随机推荐

  1. 快速傅里叶变换(FFT)_转载

    FFTFFT·Fast  Fourier  TransformationFast  Fourier  Transformation快速傅立叶变换 P3803 [模板]多项式乘法(FFT) 参考上文 首 ...

  2. mysql体系结构和sql查询执行过程简析

    一: mysql体系结构 1)Connectors 不同语言与 SQL 的交互 2)Management Serveices & Utilities 系统管理和控制工具 备份和恢复的安全性,复 ...

  3. Linux CGroup

    catalog . 引言 . Cgroup安装配置 . Cgroup使用方式 . CGroup的子系统 1. 引言 我们已经讨论了Linux下命名空间(Namespace)的基本知识,详情请参阅另一篇 ...

  4. Nginx gzip参数详解及常见问题(已解决)

    1.Nginx gzip功能 Nginx实现资源压缩的原理是通过ngx_http_gzip_module模块拦截请求,并对需要做gzip的类型做gzip,ngx_http_gzip_module是Ng ...

  5. kafka命令使用

    1.创建 topic /usr/local/kafka/bin/kafka-topics.sh --create --zookeeper zoo1:2181,zoo2:2181,zoo3:2181 - ...

  6. Java工具之上传文件

    4个代码 1.前端JSP 2.自定义异常类 3.文件上传抽象类 4.Servlet 1.JSP <%@ page contentType="text/html;charset=UTF- ...

  7. JVM 内存初学 堆(heap)、栈(stack)和方法区(method)

    这两天看了一下深入浅出JVM这本书,推荐给高级的java程序员去看,对你了解JAVA的底层和运行机制有比较大的帮助.废话不想讲了.入主题:先了解具体的概念:JAVA的JVM的内存可分为3个区:堆(he ...

  8. vue表单校验提交报错TypeError: Cannot read property 'validate' of undefined

    TypeError: Cannot read property 'validate' of undefined at VueComponent.submitForm (plat_users.html: ...

  9. js验证登录注册

    js验证登录注册的优势,在前台直接验证,不需要在后台读取返回数据验证,减轻服务器压力. 登陆验证得必要性,拦截恶意脚本的登录注册攻击.哈哈,当然有些高手是可以直接跳过js验证的. 所以还是后台验证,并 ...

  10. int、bool和str

    int bit_length 返回以二进制表示的最短长度 print(int.bit_length(10)) 结果 4 Process finished with exit code 0 int() ...