我有一个视图xml文件abc.xml
,它是一个Linearlayout
。
我还有另一个xml文件def.xml
,我想在其中使用abc.xml
。我想知道如何在我的def.xml
文件中写入此内容?
我的def.xml
文件看起来像:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</layout>
就是这样:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/abc"/>
</LinearLayout>
</layout>