zoukankan      html  css  js  c++  java
  • Shape详解

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="line"
            shape的形状,默认为矩形,可以设置为矩形(rectangle)、椭圆形(oval)、线性形状(line)、环形(ring) 
        android:dither="true"
            shape="ring"有效,表示当Bitmap和屏幕的不是相同的像素设定时支持Bitmap 抖动。“false”表示不支持。默认是“true”。
        android:innerRadius="2dp"
            shape="ring"有效,尺寸,内环的半径。
        android:innerRadiusRatio="4"
            shape="ring"有效,浮点型,以环的宽度比率来表示内环的半径。例如,值为4,表示内环半径等于环的宽度除以4,这个值是可以被android:innerRadius覆盖的,默认为9. 
        android:thickness="2dp"
            shape="ring"有效,尺寸,环的厚度
        android:thicknessRatio="5"
            shape="ring"有效,浮点型,以环的宽度比率来表示环的厚度,例如,值为5,那么环的厚度就等于环的宽度除以5。这个值是可以被android:thickness覆盖的,默认值是3.  
        android:tint="#000000"
            颜色渲染。
        android:tintMode="add"
            add - 
            screen - 取两图层全部区域,交集部分变为透明色
            src_over -  正常绘制显示,上下层绘制叠盖。
            src_in -  取两层绘制交集。显示上层。
            multiply - 取两图层交集部分叠加后颜色
            src_atop - 取下层非交集部分与上层交集部分
        android:useLevel="false"
            如果当做是LevelListDrawable使用时值为true,否则为false.
        android:visible="true">


        圆角
        <corners
            android:radius="2dp"
                底部所有角半径2dp
            android:bottomLeftRadius="2dp"
                底部左边角半径2dp
            android:bottomRightRadius="2dp"
                底部右边角半径2dp
            android:radius="2dp"
                底部所有角半径2dp
            android:topLeftRadius="2dp"
                底部顶部左边角半径2dp
            android:topRightRadius="2dp"
                底部顶部右边角半径2dp
        />
        渐变
        <gradient
            android:angle="15"
                渐变角度,必须为45的整数倍。
            android:centerColor="#000000"
                中间颜色
            android:centerX="0.2"
                0.0~1.0渐变中心X点坐标的相对位置
            android:centerY="0.5"
                0.0~1.0渐变中心Y点坐标的相对位置
            android:endColor="#000000"
                结束颜色
            android:gradientRadius="50"
                放射性渐变半径
            android:startColor="#000000"
                开始颜色
            android:type="linear"
                渐变类型。linear 线性渐变,这是默认设置。radial 放射性渐变,以开始色为中心。sweep 扫描线式的渐变。
        />
        间隔
        <padding
            android:bottom="10dp"
            android:left="10dp"
            android:right="10dp"
            android:top="10dp"/>
        尺寸
        <size
            android:height="10dp"
            android:width="10dp"/>
        填充颜色
        <solid
            android:color="#000000"/>
        描边
        <stroke
            android:color="#000000"
                描边的颜色
            android:width="1dp"
                描边的宽度
            android:dashGap=""
                虚线的间隔
            android:dashWidth=""
                虚线的宽度,值为0时是实线/>

    </shape>

    以上内容从网络上收集整理,没有测试过,呵呵!

  • 相关阅读:
    codeforces C. No to Palindromes!
    codeforces D. Pashmak and Parmida's problem
    codeforces C. Little Pony and Expected Maximum
    codeforces D. Count Good Substrings
    codeforces C. Jzzhu and Chocolate
    codeforces C. DZY Loves Sequences
    codeforces D. Multiplication Table
    codeforces C. Painting Fence
    hdu 5067 Harry And Dig Machine
    POJ 1159 Palindrome
  • 原文地址:https://www.cnblogs.com/letnet/p/8525123.html
Copyright © 2011-2022 走看看