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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context="com.example.hjw.androiddaywork01.MainActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon005"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon005"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@drawable/icon006"/> <LinearLayout
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:background="@drawable/icon005"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="2"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon005"/>
</LinearLayout> </LinearLayout>

安卓linearlayout布局的一个嵌套实例的更多相关文章

  1. Android布局_布局概述和LinearLayout布局

    一.布局概述: 布局为UI提供了一个可视化的结构,比如对于一个activity或者app widget的UI,你可以用两种方式声明布局: 在XML中声明UI元素 在运行时实例化布局元素(在java代码 ...

  2. Android 动态生成布局 (多层嵌套)

    Android 除了能够载入xml文件,显示布局外,也能够代码生成布局,并通过setContentView(View view)方法显示布局.单独的一层布局,如一个主布局加一个控件(如Button\i ...

  3. 控件布局_LinearLayout的嵌套

    import android.os.Bundle; import android.app.Activity; public class Layout03 extends Activity { @Ove ...

  4. .Net程序员快速学习安卓开发-布局和点击事件的写法

    关注今日头条-做全栈攻城狮,学代码也要读书,爱全栈,更爱生活.提供程序员技术及生活指导干货. 本系列课程 致力于老手程序员可以快速入门学习安卓开发.系统全面的从一个.Net程序员的角度一步步学习总结安 ...

  5. Python展开一个嵌套的序列

    摘自<Python Cookbook> 4.6 任务 序列中的子序列可能是序列,子序列的子项仍有可能是序列,以此类推,则序列嵌套可以达到任意的深度.需要循环遍历一个序列,将其所有的子序列展 ...

  6. 在Fragment中加一个嵌套了ListView的ScrollView(一)

    首先介绍一下这个程序的功能: 1.顶部有两个可以切换Fragment的Button 2.在其中一个Fragment中里有个ScrollView,ScrollView中有ViewFlipper,List ...

  7. Android:LinearLayout布局中Layout_weight的深刻理解

    首先看一下LinearLayout布局中Layout_weight属性的作用:它是用来分配属于空间的一个属性,你可以设置他的权重.很多人不知道剩余空间是个什么概念,下面我先来说说剩余空间. 看下面代码 ...

  8. Android学习——LinearLayout布局实现居中、左对齐、右对齐

    android:orientation="vertical"表示该布局下的元素垂直排列: 在整体垂直排列的基础上想要实现内部水平排列,则在整体LinearLayout布局下再创建一 ...

  9. JavaScript中For循环以及For循环嵌套实例

    JavaScript中For循环实例 1.打印出所有的 "水仙花数 ",所谓 "水仙花数 "是指一个三位数,其各位数字立方和等于该数本身. 例如:153是一个 ...

随机推荐

  1. Nexus远程Maven仓库索引下载教程

    下载Maven仓库索引有两种方式: 一.手动下载 首先将索引下载到本地,下载地址:nexus-maven-repository-index.zip 解压索引压缩包,将里面内容全部拷贝   关闭当前Ne ...

  2. codeforces 713D D. Animals and Puzzle 二分+二维rmq

    题目链接 给一个01矩阵, 然后每个询问给出两个坐标(x1, y1), (x2, y2). 问你这个范围内的最大全1正方形的边长是多少. 我们dp算出以i, j为右下角的正方形边长最大值. 然后用二维 ...

  3. 初学swift笔记 方法(九)

    import Foundation /* 方法 */ //实例方法 一定需要依附于对象 class MyPoint { var x: Double = 0.0 var y: Double = 0.0 ...

  4. SQL Server 为索引启动硬件加速(分区)的 2 方法

    背景知识: 如果你想看<三国>这部电视剧它有 假设它有400G这么大,现在你有两个朋友他们都已经把这部剧保存在自己的硬盘上了. A用一个硬盘就把这部剧保存了下来,B用了两个硬盘才保存了一下 ...

  5. 为TL-WR720N编译带mentohust和njit-client的openwrt固件

    openwrt的trunk版已经支持720N了.简单好多. 首先下载openwrt源码,我下的是trunk版 svn co svn://svn.openwrt.org/openwrt/trunk/ 然 ...

  6. Android下EditText中的字体不统一问题

    Android下EditText中的字体不统一问题 好久没写,今天心情好略记下解决的某bug 在一个登录界面有帐号和密码两个EditText,但是却发现两个EditText的hint的英文字体不同,看 ...

  7. U盘开发之GPIF Master模式

    在U盘开发过程中,一个人从头做到尾,经常遇到一些莫名其妙的问题,只有到官网论坛发帖.折腾困扰我最久的,就是U盘的读写性能问题了,不采用GPIF的方式,single读只有几百K,single写只有几十K ...

  8. mysql perl 抓取update语句

    <pre name="code" class="html"><pre name="code" class="ht ...

  9. [IOS]UIWebView 请求网络页面或者加载本地资源页面

    UIWebView是一个能够显示网页的IOS视图控件,我们可以用它来访问一个网站.下面是具体的实例: 操作步骤: 1.首先在xib文件中拖放一个UIWebView控件到view中 2.将下载的页面以及 ...

  10. checkbook全选/反选/全不选

    <!doctype html><html lang="en"><head> <meta charset="UTF-8" ...