<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 内部颜色 -->
<solid android:color="#00A5C6"/>
<!-- 边缘线条颜色 -->
<stroke android:width="1.0px" android:color="#00A5C6"/>
<!-- 圆角的幅度 -->
<corners
android:topLeftRadius="10dip"
android:topRightRadius="10dip"
android:bottomLeftRadius="0dip"
android:bottomRightRadius="0dip"/>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 内部颜色 -->
<solid android:color="#00A5C6"/>
<!-- 边缘线条颜色 -->
<stroke android:width="1.0px" android:color="#00A5C6"/>
<!-- 圆角的幅度 -->
<corners
android:topLeftRadius="10dip"
android:topRightRadius="10dip"
android:bottomLeftRadius="0dip"
android:bottomRightRadius="0dip"/>
</shape>
使用时直接设置background就额可以了:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_marginTop="20dip"
android:focusable="true"
android:clickable="true"
android:background="@xml/test_selector" >
</LinearLayout>