安卓:包括XML转换为其他XML [英] Android: include a xml into an other xml

查看:129
本文介绍了安卓:包括XML转换为其他XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何包含XML数据转换成其他XML数据

How to include a xml data into an other xml data

我有一个头的XML文件为我的应用程序至极,我想在我的特殊的其他内容XMLS使用 有没有方法可以包括头部到我的内容?

i have a header xml-file for my application wich i want to use in my special other content xmls is there a ways to include the header into my content?

推荐答案

使用包括标签

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"     
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
 >
  <!-- Header -->
  <include
    android:id="@+id/container_header_lyt"  
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:layout_above=...
    android:layout_toLeftOf=...
    layout="@layout/header_logo_lyt" //Name of the xml layout file you want to include
    />     

...

</RelativeLayout>

这篇关于安卓:包括XML转换为其他XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆