android 画虚线、实线,画圆角矩形,一半圆角
1、画虚线,实线:
建立dotted_line_gray.xml文件放在drawable文件夹下面。
android:shape="line" 可以修改你想要的形状
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<!-- 显示一条虚线,破折线的宽度为dashWith,破折线之间的空隙的宽度为dashGap,当dashGap=0dp时,为实线 -->
<stroke android:width="1dp" android:color="#D5D5D5"
android:dashWidth="2dp" android:dashGap="3dp" />
<!-- 虚线的高度 -->
<size android:height="2dp" />
</shape>
然后在布局的xml里面:
作为ImageView或者Linearlayout等作为背景源就可以了。
<LinearLayout
android:id="@+id/activity_line"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:background="@drawable/dotted_line_gray" />
---------
2、画圆角矩形
建立 rect_gray.xml文件放在drawable文件夹下面。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充颜色 -->
<solid android:color="#FFFFFF"></solid>
<!-- 线的宽度,颜色灰色 -->
<stroke android:width="1dp" android:color="#D5D5D5"></stroke>
<!-- 矩形的圆角半径 -->
<corners android:radius="0dp" />
</shape>
然后在布局的xml里面:
作为ImageView或者Linearlayout等作为背景源就可以了。
<LinearLayout
android:id="@+id/activity_myhezu_wantchuzu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/myhezu_dottedline_rect_green"
android:orientation="horizontal" >

3、一半圆角:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="16dp" <!--上面左圆角的半径-->
android:topRightRadius="16dp" <!--上面右圆角的半径-->
android:bottomLeftRadius="0dp" <!--下面左圆角的半径-->
android:bottomRightRadius="0dp"/> <!--下面右圆角的半径-->
<gradient android:startColor="#ffffff"
android:endColor="#ffffff"
android:angle="270"/>
<stroke android:width="1dp"
android:color="#80000000" />
</shape>

android 画虚线、实线,画圆角矩形,一半圆角的更多相关文章
- android画虚线的自定义VIew
package com.yesway.ycarplus.view; import android.annotation.SuppressLint; import android.content.Con ...
- android 画虚线,虚线圆
Paint paint = new Paint(); paint.setAntiAlias(true); paint.setStyle(Paint.Style.STROKE); paint.set ...
- Android:res之shape制作圆角、虚线、渐变
xml控件配置属性 android:background="@drawable/shape" 标签 corners ----------圆角gradient ----------渐 ...
- 【转】Android设置虚线、圆角、渐变
Android虚线圆角渐变 有图又真相,先上图再说. 点击效果: 设置虚线: <?xml version="1.0" encoding="utf-8" ...
- Android设置虚线、圆角、渐变
有图又真相,先上图再说. 点击效果: 设置虚线: <?xml version="1.0" encoding="utf-8"?> <shape ...
- Android Xfermode 实战 实现圆形、圆角图片
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/42094215,本文出自:[张鸿洋的博客] 1.概述 其实这篇本来准备Androi ...
- 学习笔记48—PS画虚线
PS画虚线步骤: 1)我们打开PS后,随便新建一个文件. 2)大小随意. 2)我们选择画笔工具,快捷键是B. 3)画笔面板的快捷键是F5. 4)点击画笔预设面板,再点击右边右上角的下三角,在弹出的菜单 ...
- iOS 画虚线
UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(, , , )]; [self.view addSubvi ...
- HTML5 Canvas 画虚线组件
前段时间由于项目需要,用到了HTML5 Canvas画图,但是没有画虚线的方法,自己写了一个HTML5 画虚线的组件. dashedLine.js if (window.CanvasRendering ...
随机推荐
- 使用Python统计深圳市公租房申请人省份年龄统计
使用Python,HtmlParser来统计深圳市保障房申请人的原籍省份分布,年龄分布等.从侧面可以反映鹏城人的地域分布.以下python代码增大了每一次获取的记录数,从而少提交几次请求.如果按照WE ...
- Dev统计选中行、如需其他数据源可留言
Clipboard.Clear(); Dictionary<string, decimal> dtary = new Dictionary<string, decimal>() ...
- webapi返回json格式优化
一.设置webapi返回json格式 在App_Start下的WebApiConfig的注册函数Register中添加下面这代码 config.Formatters.Remove(config.For ...
- Linux下常用yum命令
linux各发行版有多种包管理机制,下面介绍基于RedHat系的yum包管理命令: yum -y install xxx 无需询 ...
- 利用 Serial Over Lan(SOL)搭建 XEN 的调试信息输出环境
如有转载,请注明出处与本文连接,谢谢! 修改XEN的源码实现额外的功能,需要有一个调试环境来得到XEN的调试信息(有关源码编译并安装 XEN 请阅读我以前的博文:在CentOS下源码安装 Xen并搭建 ...
- Hibernate 基础配置及常用功能(三)
本章重点讲述Hibernate对象的三种状态以及如何配置二级缓存 有关Hibernate的三种状态如何相互转换网上都能查到,官方文档描述的也比较详细.这里主要是针对几个重点方法做代码演示. 一.状态转 ...
- Bash:-set设置位置变量结合while和shift使用
#!/bin/bash aaa=( ) bbb=(a b c d) set -- ${aaa[@]} ));do } shift done set -- echo "------------ ...
- Kafka 0.9+Zookeeper3.4.6集群搭建、配置,新Client API的使用要点,高可用性测试,以及各种坑 (转载)
Kafka 0.9版本对java client的api做出了较大调整,本文主要总结了Kafka 0.9在集群搭建.高可用性.新API方面的相关过程和细节,以及本人在安装调试过程中踩出的各种坑. 关于K ...
- [课程设计]Scrum 3.3 多鱼点餐系统开发进度(下单详细信息页面设计)
Scrum 3.3 多鱼点餐系统开发进度(下单详细信息页面设计) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点 ...
- 24章 创建TPL自定义模板(1)
鼓励分离 促进分工 smarty强大的模板引擎 自己开发可以深入了解模板引擎原理,并且简化(安全性,兼容性和功能不如开源的模板引擎) 流程图