博客
关于我
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/

你可能感兴趣的文章
MYSQL数据库进阶操作
查看>>
MySQL数据库配置文件调优详解
查看>>
MySQL数据库酒店客房管理系统(含MySQL源码) 结课作业 做的不是很好
查看>>
mysql数据库里的一些坑(读高性能mysql有感)
查看>>
MySQL数据库面试题(2021最新版)
查看>>
MySQL数据库高并发优化配置
查看>>
mysql数据恢复
查看>>
MySQL数据的主从复制、半同步复制和主主复制详解
查看>>
mysql数据碎片整理
查看>>
MySQL数据类型
查看>>
MySQL数据类型字节长度
查看>>
mysql数据被误删的恢复方案
查看>>
MySQL数据读写分离(MaxScale)上干货!!!
查看>>
mysql整库导入、导出
查看>>
mysql文本函数和数字函数
查看>>
Mysql新建用户和数据库并授权
查看>>
mysql日志
查看>>
mysql日志 事务问题_mysql因为事务日志问题无法启动
查看>>
mysql日志文件
查看>>
mysql日志管理学习笔记
查看>>