android shape 使用小结
2019独角兽企业重金招聘Python工程师标准>>>
ShapeDrawable 用于定义一个基本的几何图形(矩形,圆形,线条等),定义ShapeDrawable 的xml 文件的根元素是<shape >元素。shape 元素可指定android:shape=["rectangle"|"oval"|"line"|"ring"]属性来指明是哪种几何图形。
完整语法(摘自疯狂讲义)
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/androidandroid:shape=["rectangle"|"oval"|"line"|"ring"]><!--四个角的弧度--><corners android:radius="integer"android:topLeftRadius="integer"android:topRightRadius="integer"android:bottomLerfRadius="integer"android:bottomRightRadius="integer"/><!--渐变填充--><gradient android:angle="integer"android:centerX="integer"android:centerY="integer"android:centerColor="integer"android:endColor="color"android:gradientRadius="integer"android:startColor="color"android:type=["linear"|"radial"|"sweep"]android:usesLevel=["true"|"false"] /><!--内边距--><padding android:left="integer"android:top="integer"android:right="integer"android:bottom="integer"/><!--大小--><size android:width="integer"android:color="color"android:dashWidth="integer"android:dashGap="integer"/><!--单色填充--><solid android:color="color"/><!--边框--><stroke android:width="integer"android:color="color"android:dashWidth="integer"android:dashGap="integer"/></shape>
注:android:useLevel. 用作 LevelListDrawable,设置为true. 通常需要将这个值设置为false,否则图形会不显示。并且这个属性只在形状为 ring 时才有效。
转载于:https://my.oschina.net/qzzsunly/blog/477919
android shape 使用小结相关推荐
- Android Shape 的使用
学而时习,温故而知新. 今天复习shape 画各种常见类型的背景图 使用: 当在 java 代码R.drawable.文件的名称 当在布局中时 android:background="@dr ...
- android shape.xml 文件使用
设置背景色可以通过在res/drawable里定义一个xml,如下: <?xml version="1.0" encoding="utf-8"?> ...
- Android Shape使用
说明 在Android开发中,使用shape可以很方便的帮我们画出想要的背景,相对于png图片来说,使用shape可以减少安装包的大小,而且能够更好的适配不同的手机. 使用 先贴出官网上的说明: &l ...
- android shape的可选参数以及每个参数的含义与用法!
2019独角兽企业重金招聘Python工程师标准>>> <span style="font-size:18px"><?xml version=& ...
- Android Shape Drawable Resources
本文主要介绍Drawable Resources的一种,Shape Drawable Resources的使用.其他Drawable类似 经常需要自己设置某个view的背景,比如类似新浪微博客户端微博 ...
- Android shape的使用(圆角矩形)
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http: ...
- android shape 按钮背景_Android button, xml文件定义形状,代码中修改背景颜色
1. 首先在drawable文件夹定义一个shape.xml文件,内容如下: xmlns:android="http://schemas.android.com/apk/res/androi ...
- android shape 自定义,Android自定义shape的使用
MainActivity如下: package cn.testshape; import android.os.Bundle; import android.app.Activity; /** * D ...
- android layerlist bitmap,android shape类似的 另一个 高端用法:layer-list
android shape类似的 另一个 高端用法:layer-list : 简介: 将多个图片或上面两种效果按照顺序层叠起来 " <?xml version="1.0&qu ...
- android shape.xml 属性详解
转载源:http://blog.csdn.net/harvic880925/article/details/41850723 一.简单使用 刚开始,就先不讲一堆标签的意义及用法,先简单看看shape标 ...
最新文章
- 推送提交到另一个分支
- Py之Numpy:Numpy库中常用函数的简介、应用之详细攻略
- 【安全漏洞】gomarkdown/markdown 项目的 XSS 漏洞产生与分析
- 使用vl_sift提取图像特征
- java mplayer 源码_师兄写的一个JAVA播放器的源代码
- Vue+ECharts的小示例
- OPNET网络仿真分析-1.1.2、OPNET简介
- Scala 解析 URL
- 不知道如何实现服务的动态发现?快来看看 Dubbo 是如何做到的
- 计算机怎么删除表格,怎么快速删除电脑word文档中不想要的表格
- 微信小程序如何上传图片
- GoogleCode SVN应用(源代码学习)
- 企业微信怎么批量加人?怎么管理员工?看看这套系统
- 大数据整合方案架构总结
- C语言————输出It‘s a computer中的computer
- Ubuntu 搜狗输入法 双拼输入法
- Flutter 布局之企鹅电竞
- python关于二手房的课程论文_用Python对二手房信息数据清洗及简单分析
- numpy迭代数组nditer、flat
- NeXt VLAD多模态视频分类