简体   繁体   English

Android布局

[英]Android layouts

Hi I wounder if itpossible to have a view inside of a view, Iam going to have a toolbar on my android app,, and this toolbar is going to be shown in many activites, so I have xmlfile for each of the activites, and I wounder if should create an cml only for the toolbar. 嗨,我很可能在一个视图中有一个视图,我将在我的android应用程序中有一个工具栏,并且这个工具栏将在许多活动中显示,所以我为每个活动都有xmlfile,如果只应该为工具栏创建一个cml。 and then use ut in other xml files. 然后在其他xml文件中使用ut。

How is that possible, so i don't have dublicated xl data. 那怎么可能,所以我没有成对的XL数据。

yes, you can use the include tag: 是的,您可以使用include标记:

<include android:id="@+id/toolbarInclude" layout="@layout/toolbar"/>

where the toolbar is defined in a separate res/layout/toolbar.xml file 工具栏在单独的res / layout / toolbar.xml文件中定义的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM