zoukankan      html  css  js  c++  java
  • shape 学习

    shape 学习

    目录

    <?xml version="1.0" encoding="utf-8"?>
    <shape
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape=["rectangle" | "oval" | "line" | "ring"] >
        <corners
            android:radius="integer"
            android:topLeftRadius="integer"
            android:topRightRadius="integer"
            android:bottomLeftRadius="integer"
            android:bottomRightRadius="integer" />
        <gradient
            android:angle="integer"
            android:centerX="integer"
            android:centerY="integer"
            android:centerColor="integer"
            android:endColor="color"
            android:gradientRadius="integer"
            android:startColor="color"
            android:type=["linear" | "radial" | "sweep"]
            android:useLevel=["true" | "false"] />
        <padding
            android:left="integer"
            android:top="integer"
            android:right="integer"
            android:bottom="integer" />
        <size
            android:width="integer"
            android:height="integer" />
        <solid
            android:color="color" />
        <stroke
            android:width="integer"
            android:color="color"
            android:dashWidth="integer"
            android:dashGap="integer" />
    </shape>
    

    back to top

    shape设置形状

    • rectangel设置矩形
    • oval设置椭圆
    • line设置线
    • ring设置圆环

    back to top

    corners是圆角大小,也就是边边设置为圆形的弧度显著程度

    包含

    • radius 总体的圆角程度
    • topLeftRadius左上方的圆角程度
    • topRightRadius右上方的圆角程度
    • bottomLeftRadius左下方的圆角程度
    • bottomRightRadius右下方的圆角程度

    back to top

    gradient设置颜色渐变

    • centerX,centerY渐变的中心点(圆心)
    • linear 线性渐变
    • radial 放射渐变,gradientRadius也必须设定
    • sweep 扫描性渐变
    • startColor渐变起始的颜色
    • centerColor中心点颜色
    • edgeColor边缘颜色
    • endColor渐变结束的颜色
    • angle渐变的角度

    back to top

    padding设置内边距

    bottom设置顶部内边距
    left设置左边内边距
    right设置右边内边距
    top设置顶部内边距

    back to top

    size设置大小

    width设置宽度大小
    height设置高度大小

    back to top

    solid设置填充颜色

    color设置内填充颜色

    back to top

    stroke设置边框大小以及边框颜色

    width设置边框的大小
    color设置边框的颜色

    back to top

    这是小睿的博客,如果需要转载,请标注出处啦~ヾ(≧▽≦*)o谢谢。
  • 相关阅读:
    高效能人士懂得忽视,知道怎样说“不”
    CheckBoxPreference组件
    SQL基础--&gt; 约束(CONSTRAINT)
    html5--6-7 CSS选择器4
    html5--6-6 CSS选择器3
    html5--6-5 CSS选择器2
    html5--6-4 CSS选择器
    html5--6-3 CSS语法2
    html5--6-2 CSS语法
    html5--6-1 引入外部样式表
  • 原文地址:https://www.cnblogs.com/Yunrui-blogs/p/12496052.html
Copyright © 2011-2022 走看看