博客
关于我
Android使用xml的shape自定义图形
阅读量:351 次
发布时间:2019-03-04

本文共 886 字,大约阅读时间需要 2 分钟。

android:shape=[“rectangle” | “oval” | “line” | “ring”]
shape的形状,默认为矩形,可以设置为矩形(rectangle)、椭圆形(oval)、线性形状(line)、环形(ring)

1.自定义纯色圆形
round.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"       android:shape="rectangle" >    <solid android:color="#283593"/>    <corners android:radius="50dp" /></shape>
//半径为50dp,颜色为#283593的圆形<ImageView    android:layout_width="50dp"    android:layout_height="50dp"    android:scaleType="center"    android:src="@drawable/manual_tuner_band_bg" />

2.自定义纯色矩形
rectangle.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"       android:shape="rectangle" >    <solid android:color="#283593"/>    <corners android:radius="50dp" /></shape>
//宽为30dp,高为50dp,颜色为#283593的矩形<ImageView    android:layout_width="30dp"    android:layout_height="50dp"    android:scaleType="center"    android:src="@drawable/manual_tuner_band_bg" />

转载地址:http://ysre.baihongyu.com/

你可能感兴趣的文章
Nginx + Tomcat + SpringBoot 部署项目
查看>>
Nginx + uWSGI + Flask + Vhost
查看>>
Nginx - Header详解
查看>>
nginx - thinkphp 如何实现url的rewrite
查看>>
Nginx - 反向代理、负载均衡、动静分离、底层原理(案例实战分析)
查看>>
Nginx - 反向代理与负载均衡
查看>>
nginx 1.24.0 安装nginx最新稳定版
查看>>
nginx 301 永久重定向
查看>>
nginx connect 模块安装以及配置
查看>>
nginx css,js合并插件,淘宝nginx合并js,css插件
查看>>
Nginx gateway集群和动态网关
查看>>
nginx http配置说明,逐渐完善。
查看>>
Nginx keepalived一主一从高可用,手把手带你一步一步配置!
查看>>
Nginx Location配置总结
查看>>
Nginx log文件写入失败?log文件权限设置问题
查看>>
Nginx Lua install
查看>>
nginx net::ERR_ABORTED 403 (Forbidden)
查看>>
vue中处理过内存泄露处理方法
查看>>
Nginx RTMP 模块使用指南
查看>>
Nginx SSL 性能调优
查看>>