圆角TestView的实现

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <!-- shape : 设置图片的行状态   rectangle:矩形 oval:随园  line:线  ring:环形-->
    <!-- 圆角 -->
    <!-- corners:弧度 用来设置圆角半径  radius:四个角的弧度 -->
    <!--<corners android:radius="9dp"/>-->
    <!-- 4个角可以任意设置 -->
    <corners
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp"
        android:bottomLeftRadius="10dp"
        android:bottomRightRadius="10dp"/>

    <!-- 渐变  angle:渐变的角度(处理比较复杂的线或者图片) -->
    <gradient
        android:startColor="#f00"
        android:centerColor="#00f"
        android:endColor="#0f0"
        android:angle="45"/>
        <!--android:useLevel="true"-->
        <!--android:type="radial"-->
        <!--android:centerX="0"-->
        <!--android:centerY="0"-->
        <!--android:gradientRadius="90"-->

    <!-- 间隔:各方向的间隔-->
    <padding
        android:left="2dp"
        android:top="2dp"
        android:right="2dp"
        android:bottom="2dp"/>

    <!-- 大小,宽度和高度 -->
    <size
        android:width="50dp"
        android:height="40dp"/>

    <!-- 填充的颜色 -->
    <!--<solid android:color="@android:color/white"/>-->

    <!-- 描边:分为虚线和实线 width:边宽 color:边颜色 dashWidth:点的宽度  dashGap:点与点之间的距离(实线不需要此属性)-->
    <stroke
        android:width="1dp"
        android:color="@android:color/black"
        android:dashWidth="1dp"
        android:dashGap="2dp"
       />

</shape>

这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_137237056

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值