`
gryphone
  • 浏览: 426873 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

Layout include

阅读更多

布局include

 

 

 

1. 定义一个布局:text.main

 

 

2. 如何include

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<include android:id="@+id/cell1" layout="@layout/text" />
<include layout="@layout/text" />
</LinearLayout>

 

分享到:
评论
1 楼 hezhou_0521 2010-12-08  
截一张图就有说服力了,看一下它到底起什么作用。

相关推荐

    使用include实现布局(layout)复用

    我们是给这些个Activity布局文件都统一加上一样的布局代码,但是维护起来很麻烦,修改不方便,有没有一种类似于编程语言的include语法呢?答案是有的,但是sdk的demo并没有说出使用方法,但这并不说明不好使用,其实...

    Android开发之merge结合include优化布局

    merge结合include优化android布局,效果不知道,个人感觉使用上也有很大的局限,不过还是了解一下,记录下来。 布局文件都要有根节点,但android中的布局嵌套过多会造成性能问题,于是... android:layout_width=wrap_co

    FloatLayout:包括HeaderLayout,FloatLayout,ContentLayout

    FloatLayout include HeaderLayout,FloatLayout,ContentLayout ##类似美团,点评,微博的浮动容器

    Grid Layout in CSS - 2016

    With the introduction of the CSS Grid Layout spec, you will not need to include a separate stylesheet just to use the grid system. Another advantage is that you will not have to rely on properties ...

    android xml中include标签的使用

    关于xml布局中标签&lt;include /&gt;的使用的一个Demo

    Android代码-react-native-zoom-layout

    react-native-zoom-layout Getting started $ npm install react-native-zoom-layout --save Mostly automatic installation ...Append the following lines to android/settings.gradle: include ':react-na

    android 右侧滑动菜单 主页滑动 窗帘效果 拉幕

    &lt;include layout="@layout/main_left" /&gt; android:id="@+id/sliding_menu_view" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;include layout="@layout/main_right" /&gt; ...

    解析android中include标签的使用

    如果都写在一个xml文件中,代码显得很冗余,并且可读性也很差,所以我们可以把相同布局的代码单独写成一个模块,然后用到的时候可以通过&lt;include&gt; 标签来重用layout代码。app_title.xml: 代码如下:&lt;?xml version...

    magento static block

    Ability to place any block in any position by easily changing CMS page layout Unlimited number of blocks inside each position Unlimited number of content items inside each block Block items can ...

    CMOS_Circuit_Design_Layout_and_Simulation_2nd_Baker.part01

    Features include: Integrated-circuit layout software for Windows designed by David Boyce Updated materials to reflect CMOS technology's movement into nanometer sizes Discussions on phase- and ...

    Android在layout xml中使用ViewStub完成动态加载问题

     &lt;include layout=@layout/otherLayout/&gt;  2、动态加载:需要被加载的模块初始时并没有被加载进内存,在你需要加载这个模块才会被动态的加载进去。  &lt;ViewStub android:layout=@layout/otherLayout/&gt;  还要把...

    Android布局技巧之include、merge与ViewStub标签的巧用

    app开发过程中,会遇到不同页面里有相同的布局,这时我们可以将这些通用的布局提取出来到一个单独的layout文件里,再使用&lt;include&gt;标签引入到相应的页面布局文件里,主要通过include的layout属性引用。  举个栗子...

    WeChatSample

    &lt;include layout="@layout/top_layout" /&gt; android:layout_weight="1" android:id="@+id/vp" android:layout_width="match_parent" android:layout_height="0dp"&gt; android:paddingTop="10dp" android:...

    Android抽象布局——include、merge 、ViewStub详解

    在布局优化中,Androi的官方提到了这三种布局&lt;include&gt;、、,并介绍了这三种布局各有的优势,下面也是简单说一下他们的优势,以及怎么使用,记下来权当做笔记。... android:layout_width=”match_parent”

    android使用include调用内部组件的方法

    本文实例讲述了android使用include调用内部组件的方法。分享给大家供大家参考。具体如下: 例子一: sublayout.xml &lt;?xml version=1.0 encoding=utf-8?&gt; &lt;LinearLayout xmlns:android=...

    guss-layout:低级响应式布局模式

    bower install guss-layout --save @import ' path/to/_row.scss ' ; @import ' path/to/_columns.scss ' ; // Uncomment to output utility classes // @include guss-row-utility; // @include guss-columns-...

    游戏.sln一个游戏的代码类鞥看懂的就看看吧

    #include &lt;graphics.h&gt; // 引用图形库头文件 #include #include #if 0 int main1() { initgraph(640, 480); MOUSEMSG m; int r;// 创建绘图窗口,大小为 640x480 像素 while (1) { m = GetMouseMsg(); ...

    css2中文手册 学习css的必选

    这个是学习css 必须要有的手册,里面包含了大部分css的属性,规则,下面是大纲 CSS Properties Reference 样式表属性 字体 Font ...include-source quotes content counter-increment counter-reset

    office for mac 2011 portable genius

    MS Office for Mac 2011 include The ribbon. The ribbon makes it easier than ever to work with the most common tools for building new documents. Publishing layout. As seen in Figure 1.4, this ...

    高仿微信界面

    &lt;include layout="@layout/layout_main_top" /&gt; android:id="@+id/vp_mainvp" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"&gt; android:...

Global site tag (gtag.js) - Google Analytics