试试这个
在您的布局中
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#FFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dip"
android:background="@drawable/background"
android:orientation="vertical" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@xml/shape_round_rect"
android:orientation="vertical" />
</FrameLayout>
& 在你的 xml 中用于形状
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="15dip" />
<stroke
android:width="5dip"
android:color="#FFF" />
</shape>