<合并>的简单例子和<包括>在 Android XML 布局中的使用
本教程将介绍<合并>的简单例子和<包括>在 Android XML 布局中的使用的处理方法,这篇教程是从别的地方看到的,然后加了一些国外程序员的疑问与解答,希望能对你有所帮助,好了,下面开始学习吧。
问题描述
我很好奇 Android XML 布局中的 <merge>
和 <include>
标签.我已经阅读了两篇教程,但还没有找到一个简单的示例用法.
如果有人能提供这样的例子或指点一下,我会很高兴.
推荐答案
some_activity.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
// some views
<include layout="@layout/view_part"/>
// probably more views
</LinearLayout>
view_part.xml:
<merge xmlns:android="http://schemas.android.com/apk/res/android">
// the views to be merged
</merge>
好了关于<合并>的简单例子和<包括>在 Android XML 布局中的使用的教程就到这里就结束了,希望趣模板源码网找到的这篇技术文章能帮助到大家,更多技术教程可以在站内搜索。