xml布局中include的使用
参考:http://blog.csdn.net/harvic880925/article/details/17263275
include_button1.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="anjian1" /> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按键1"/> </LinearLayout>
include_button2.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="anjian2" /> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按键2"/> </LinearLayout>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
<include
android:id="@+id/key1"
layout="@layout/include_button1"></include> <include
android:id="@+id/key2"
layout="@layout/include_button2"></include> </LinearLayout>
xml布局中include的使用的更多相关文章
- 安卓xml布局中 android:paddingBottom="@dimen/activity_vertical_margin"是什么意思?
@dimen/activity_vertical_margin 是什么意思? @dimen/activity_vertical_margin这个的意思就是在你的values文件夹下面的dimens文件 ...
- android布局中画线的方法
1.自定义View画线 http://fariytale.iteye.com/blog/1264225 下面介绍几种简单的方法 2.textView和View画直线 <TextView andr ...
- 第五篇:在SOUI中使用XML布局属性指引(pos, offset, pos2type)
窗口布局的概念 每一个UI都是由大量的界面元素构成的,在Windows编程,这些界面元素的最小单位通常称之为控件. 布局就是这些控件在主界面上的大小及相对位置. 传统的布局一般使用一个4个绝对坐标来定 ...
- 【转】在Android布局中使用include和merge标签
内容转自:http://fengweipeng1208.blog.163.com/blog/static/21277318020138229754135/ 在我们开发android布局时,经常会有很多 ...
- 我的Android进阶之旅------>Android中的布局优化 include、merge 、ViewStub
1.如何重用布局文件? 可以使用<include>标签引用其他的布局文件,并用android:id属性覆盖被引用布局文件中顶层节点的android:id属性值.代码如下: <!--引 ...
- android布局中使用include及需注意点
在android布局中,使用include,将另一个xml文件引入,可作为布局的一部分,但在使用include时,需注意以下问题: 一.使用include引入 如现有标题栏布局block_header ...
- Android Studio xml文件中的布局预览视图
操作系统:Windows 10 x64 IDE:Android Studio 3.3.1 更新了Android Studio之后,xml文件中的布局预览视图变得如此简洁! 原因是没有勾选Show La ...
- Android中measure过程、WRAP_CONTENT详解以及 xml布局文件解析流程浅析
转自:http://www.uml.org.cn/mobiledev/201211221.asp 今天,我着重讲解下如下三个内容: measure过程 WRAP_CONTENT.MATCH_PAREN ...
- Android Fragment之间的通信(用fragment替换掉XML布局文件中的一个线性布局)
1.XML布局 (1)主界面 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xml ...
随机推荐
- driver.get()和driver.navigate().to()到底有什么不同?-----Selenium快速入门(四)
大家都知道,这两个方法都是跳转到指定的url地址,那么这两个方法有什么不同呢?遇到这种情况,第一反应就是查查官方的文档. 官方文档的说法是:Load a new web page in the cur ...
- 重装SQL前,一定要把SQL2005、SQL2008之类的彻底删除干净
0.预备 如果你曾删除过VS2010或者VS2008之类的,同理也要照此方法删除 1.步骤,顺序无妨 卸载程序:控制面板---查找SQL..NET 删除干净 停掉SQL的所有服务: 计算机--管 ...
- ObjectARX动态添加AutoCAD传统下拉菜单入门篇(一)
ObjectARX动态添加传统下拉菜单入门篇 图文by edata , 转载注明出处 http://www.cnblogs.com/edata AutoCAD 添加传统下拉菜单有很多种方式,比较典型 ...
- Cannot sending data from mongodb into elasticsearch using logstash
Question: Hi all, i have an issue when i try to get data from mongodb to elasticsearch using logstas ...
- [ActionScript 3.0] 模拟win7彩色气泡屏保效果
主文件: package { import com.views.BubbleView; import com.views.ColorfulBubble; import flash.display.Sp ...
- jquery源码解析:jQuery数据缓存机制详解1
jQuery中有三种添加数据的方法,$().attr(),$().prop(),$().data().但是前面两种是用来在元素上添加属性值的,只适合少量的数据,比如:title,class,name等 ...
- VMware Workstation 14 pro License Keys
AC5XK-0ZD4H-088HP-9NQZV-ZG2R4 CG54H-D8D0H-H8DHY-C6X7X-N2KG6 ZC3WK-AFXEK-488JP-A7MQX-XL8YF ZC5XK-A6E0 ...
- [总结帖] 后端MVC V.S. 前端MVVM
Web编年史: Web1.0 —— 静态页面.简单预处理语言草案:PHP.JSP.ASP Web2.0 —— 企业级架构.一站式解决方案(MVC):J2EE.Spring.Asp.net Web2.5 ...
- Postgres中的SpinLock锁
我们知道,在数据库中为了并发控制,少不了要使用各种各样的锁(lock).PostgreSQL中也不例外. 在PostgreSQL中有三种级别的锁,他们的关系如下: |上层 RegularLock | ...
- python web开发学习笔记一:javascript基础
一.认识js: 能进入到软件所实习是我的最大的收获,也是我的荣幸,我相信努力付出一定能够换回收获. 项目最先开始的是接触到web前端的一些内容,我们需要利用flask搭建应该有的框架.我有一些pyth ...