1、创建xml文件
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" ><!-- <solid android:color="#000000" /> -->
<solid android:color="#000000" />
<corners
android:bottomLeftRadius="2dp"
android:bottomRightRadius="20dp"
android:topLeftRadius="20dp"
android:topRightRadius="40dp" />
</shape>
2、layout文件中使用xml作为背景
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00FFFFFF"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<LinearLayout
android:layout_width="260dip"
android:layout_height="200dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:layout_marginTop="15dip"
android:background="@drawable/corners_bg" >
<!-- android:background="#000000" > -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/corners_bg"
android:text="@string/hello_world" />
</LinearLayout>
</LinearLayout>
3、工程目录:
4、效果图