美文网首页
Shape的使用

Shape的使用

作者: 秋雨实 | 来源:发表于2017-12-15 12:44 被阅读0次
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    
    <!-- 圆角 -->
    <corners
        android:radius="9dp"
        android:topLeftRadius="2dp"
        android:topRightRadius="2dp"
        android:bottomLeftRadius="2dp"
        android:bottomRightRadius="2dp"/><!-- 设置圆角半径 -->
    
    <!-- 渐变 -->
    <gradient
        android:startColor="@android:color/white"
        android:centerColor="@android:color/black"
        android:endColor="@android:color/black"
        android:useLevel="true"
        android:angle="45"
        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="50dp"/><!-- 宽度和高度 -->
    
    <!-- 填充 -->
    <solid
        android:color="@android:color/white"/><!-- 填充的颜色 -->
    
    <!-- 描边 -->
    <stroke
        android:width="2dp"
        android:color="@android:color/black"
        android:dashWidth="1dp"
        android:dashGap="2dp"/>
    
</shape>

相关文章

  • android 自定义图形shape的使用

    自定义图形shape的使用 1 使用shape 的好处: 2 自定义shape的步骤: 3 shape子属性 4 ...

  • Android使用Shape实现ProgressBar样式

    使用Shape实现样式 使用Shape中的ring实现,如下布局ring.xml: 使用rotate使之旋转 如下...

  • Android中shape中的属性大全

    Android中常常使用shape来定义控件的一些显示属性,今天看了一些shape的使用,对shape有了大体的了...

  • Android shape使用笔记

    Android中常常使用shape来定义控件的一些显示属性,今天看了一些shape的使用,对shape有了大体的了...

  • 【Android程序开发】shape属性的简介和使用

    目录 1.shape简介 2.shape属性详解 3.shape简单使用 具体操作 一、shape简介 设置sha...

  • shape的使用

    一、简单使用 1、新建shape文件 首先在res/drawable文件夹下,新建一个文件,命名为:shape.x...

  • Shape的使用

    shape用于设定形状,可以在selector,layout等里面使用,有6个子标签,各属性如下: andr...

  • shape的使用

    shape可以定义一个View空间的,圆角,边框,padding,大小,填充颜色,渐变颜色。 shape定义 1 ...

  • Shape的使用

  • Android-Shape

    Android-Shape shape一个用来定义形状的工具,或者说使用画图的,图片用于做背景图。 shape定义...

网友评论

      本文标题:Shape的使用

      本文链接:https://www.haomeiwen.com/subject/drarwxtx.html