【Android_樣式】Selector與shape結合

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_selected="true"><shape>

            <!-- 實心 -->
            <solid android:color="#e5e6e7" />
            <!-- 圓角 -->
            <corners android:radius="5dp" />

            <stroke android:width="0.5dp" android:color="#c9c9c9" />
        </shape></item>
    <item android:state_pressed="true">
        <shape>

            <!-- 實心 -->
            <solid android:color="#e5e6e7" />
            <!-- 圓角 -->
            <corners android:radius="5dp" />

            <stroke android:width="0.5dp" android:color="#c9c9c9" />
        </shape>
        
        </item>
    <item>
        <shape>
            <!-- 實心 -->
            <solid android:color="#ffffff" />
            <!-- 圓角 -->
            <corners android:radius="5dp" />

            <stroke android:width="0.5dp" android:color="#c9c9c9" />
        </shape>
     </item>

</selector>

或參考:android

http://blog.csdn.net/brokge/article/details/9713041 .net

http://blog.csdn.net/bear_huangzhen/article/details/24488337 code

相關文章
相關標籤/搜索