我有第一个和第二个布局,我想先插入第二个.
我想将第二个布局插入到具有id @ id / layout的布局中
当我按下按钮获取布局时,它会显示按钮底部的第二个布局
第一个布局
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:id="@+id/btn_get_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Layout" />
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
第二个布局
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/card_base"
android:orientation="vertical" >
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/img_cover"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:scaleType="fitXY"
android:src="@drawable/card_beauty" />
android:id="@+id/img_photo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="20dp"
android:scaleType="fitXY"
android:src="@drawable/sample_0" />