2011/03/22

Android使用shape建構簡單形狀

shape 寫法基本大概如下


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

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

  android:shape="rectangle">

<stroke android:width="1px" android:color="#A9B7CA" />

<solid android:color="#A9B7CA" />

<corners android:radius="1dp"

        android:bottomRightRadius="0dip"

        android:bottomLeftRadius="0dip"

  android:topLeftRadius="0dip"

android:topRightRadius="4dip" />

</shape>


上面stroke為邊框,solid為背景色,corners 為邊角設定

沒有留言 :