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>
效果图:
文件名: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>
<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>
相关文章推荐
- Android 内存优化汇总
- 【Android效果集】弹幕效果
- Android学习摘记——简单的自定义View(自绘控件)
- Android自定义组合控件详细示例 (附完整源码)
- android studio 百度地图使用环境配置及230错误码解决方法
- Android获取控件坐标,触摸点坐标 getX getRawX
- Android Studio基础之项目目录结构(四)-学习篇
- Android教程 -09 数据的持久化存储
- Android教程 -09 数据的持久化存储
- Android 开发常用的工具类
- Fragment生命周期 android基础三
- android 窗口管理
- Android基础:翻页控件Viewpager的使用方法,viewpager+fragment混合使用
- Android—ListView Item 展开动画效果
- Android 图片加载Bitmap OOM错误解决办法
- GitHub 优秀的 Android 开源项目
- android 屏幕适配(一)基本适配
- Android所有View通用下拉刷新上拉加载控件
- Android中获取应用程序(包)的信息-----PackageManager的使用
- Android页面布局控件-Android学习笔记