Shape 的简单使用

来源:互联网 发布:知乎 放假 编辑:程序博客网 时间:2024/06/05 02:52

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"

    android:shape="rectangle">

    <!--角度-->

    <corners android:radius="15dp"/>

    <!--渐变-->

    <gradient android:startColor="#ff0000" android:endColor="#0000ff"/>

    <!--固定色,和渐变只能有一个-->

    <!--<solid android:color="#ffffff"/>-->

    <!--边框-->

    <!--<stroke android:width="2dp" android:color="#000000"/>-->

    <!--虚线框-->

    <stroke android:dashWidth="5dp"

        android:dashGap="4dp"

        android:width="3dp"

        android:color="#000000"/>


</shape>


file:///Users/android-sdk-macosx/docs/guide/topics/resources/drawable-resource.html


0 0