这在安卓中是否可行?
我有一个
xml
design1文件这个文件我想添加另一个xml
design2 ..(即)
第一个
xml
是第二个中的一部分xml
设计2
要在另一个 XML 布局文件中包含一个 XML 布局,您应该使用
include
关键字
<include layout="@layout/you_xml_layout_name" />
LayoutInflater
.
你可以这样做,是的。通常你只想对动态内容执行此操作,例如 ListView 或 GridView 中的列表项。
如果您只想要可以在多个活动布局中重复使用的静态内容,则可能需要在布局中使用“include”标签。
请在您的 xml 中包含布局
<include
android:id="@+id/"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="@layout/viewgroup_bottom_bar" /> // please set proper layout name in your layout folder