android初级学习之使用shape显示圆形
来源:互联网 发布:淘宝seo pdf 编辑:程序博客网 时间:2024/05/02 04:21
今天项目中有个需求:TextView和ImageView需要显示为圆形。于是乎,就百度了一下,原来用shape可以轻松解决。下面就简单来说以下如何使用:
其实也是相当于替换background属性的:
首先在drawable下新建一个round.xml文件:
<?xml version="1.0" encoding="UTF-8"?><shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 描边 --> <stroke android:width="1.0px" android:color="#ffa50303"/> <!-- 填充--> <solid android:color="#ffffffff"/></shape>
然后在属性:android:background中引用该文件即可。
android:background="@drawable/round.xml"
文末附上shape一些常用属性值以便哪天需要用上:
Android中shape中的属性大全
0 0
- android初级学习之使用shape显示圆形
- Android初级进阶之Shape
- android shape 圆形背景
- android初级学习之ListView的使用
- android初级学习之selector的使用
- Android使用shape制作圆形控件及添加弹跳动画
- Android使用shape制作圆形控件及添加弹跳动画
- Android使用shape制作圆形控件及添加弹跳动画
- Android - shape圆形画法(oval)
- Android - shape圆形画法(oval)
- Android 绘图和shape圆形
- Android学习之shape属性
- 【android学习】 xm之shape
- android之Shape的使用
- Android 之 Shape使用总结
- Android之shape的使用
- Android初级学习之Intent的简单使用
- android学习 读书笔记之 android 绘图shape
- C语言中堆和栈的区别
- 2016-10-20 会议总结及感悟
- Google图片加载库Glide的简单封装GlideUtils
- C++ fstream读写文件
- JAVA常见面试问题以及答案
- android初级学习之使用shape显示圆形
- oracle11g新特性初始区段创建推迟到第一条记录插入表中
- JS制作支付倒计时页面
- 《并发编程的艺术》学习笔记 第1章---并发编程的挑战
- lua与C相互调用
- Spring整合Mybatis(MapperScannerConfigurer方式)
- 【数据结构学习1】关于typedef,struct,&,局部全局变量,时间复杂度
- 嵌入式驱动那年的笔试面试-有干货
- 一款轻量的微信支付组件