您的位置:首页 > 移动开发 > Android开发

android如何在一个布局文件中包含另外一个布局文件(include属性)

2015-12-10 14:14 567 查看
效果图:



<span style="background-color: rgb(255, 255, 255);">
</span><span style="color:#ff0000;"><span style="font-size:18px;">文件名:activity_app_about.xml</span></span>
<?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="wrap_content"
android:background="#fcfcfc"
android:orientation="vertical" >

<RelativeLayout
android:id="@+id/zzu_introduction"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:background="@drawable/title_bar"
android:gravity="center_vertical" >

<Button
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="@drawable/title_btn_back"
android:onClick="back"
android:text="@string/action_back"
android:textColor="#fff"
android:textSize="14sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/zzu_introduction"
android:textColor="#ffffff"
android:textSize="20sp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<strong>  <span style="color:#ff0000;">android:layout_below="@id/zzu_introduction"</span></strong>
android:layout_marginBottom="14dp"
android:layout_marginTop="14dp" >
<span style="font-size:18px;">
<strong><span style="color:#ff0000;background-color: rgb(255, 255, 153);"> <include
android:layout_width="fill_parent"
android:layout_height="wrap_content"
layout="@layout/app_intruction" /></span></strong></span>
</RelativeLayout>

</RelativeLayout>


效果图:



文件名:app_introduction.xml

<?xml version="1.0" encoding="utf-8"?>
<strong><span style="color:#ff0000;"><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"</span></strong>
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/preference_single_item"
android:orientation="vertical" >

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:contentDescription="@string/zzu_introduction"
android:src="@drawable/logo_small" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/app_name"
android:textColor="#000000"
android:textSize="25sp" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:text="@string/app_about1"
android:textColor="#000000"
android:textSize="15sp" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:text="@string/app_about2"
android:textColor="#000000"
android:textSize="15sp" />

</LinearLayout>

<strong><span style="color:#ff0000;"></ScrollView></span></strong>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: