一、介绍

二、
1.linear_layout.xml

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="#440000" > <LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ff0000">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="一"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="二"/>
</LinearLayout> <LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00ff00"
android:layout_marginLeft="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="一"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="二"/>
</LinearLayout>
</LinearLayout>

2.layout_weight.xml

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#440000" > <TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
android:background="#00ff00"
android:text="11111111"
android:layout_weight="1"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="30sp"
android:background="#0000ff"
android:text="二"
android:layout_weight="2"/>
</LinearLayout>

3.MainActivity.java

     @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_weight_layout);

ANDROID_MARS学习笔记_S01_007Linear_layout嵌套与layout_weight的设置的更多相关文章

  1. 【转】 树莓派学习笔记——I2C设备载入和速率设置

    原文网址:http://blog.csdn.net/xukai871105/article/details/18234075 1.载入设备 方法1——临时载入设备 sudo modprobe -r i ...

  2. 树莓派学习笔记——I2C设备载入和速率设置

    原文:http://blog.csdn.net/xukai871105/article/details/18234075 1.载入设备 方法1——临时载入设备 sudo modprobe -r i2c ...

  3. ANDROID_MARS学习笔记_S01_008Linear_layout例子

    1.netstone_layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLay ...

  4. ANDROID_MARS学习笔记_S02_004_ExpandableListActivity

    1.main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" x ...

  5. Python学习笔记--gevent嵌套使用

    这篇主要是接着上篇的,实验gevent嵌套使用,看情况如何.还是先上代码. #!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-0 ...

  6. ANDROID_MARS学习笔记_S01_012_RatingBar

    1.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...

  7. ANDROID_MARS学习笔记_S01_012_SeekBar

    1.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...

  8. ANDROID_MARS学习笔记_S01_011ProgressBar

    文档是这样来设置样式 <ProgressBar android:layout_width="wrap_content" android:layout_height=" ...

  9. ANDROID_MARS学习笔记_S01_010日期时间控件

    1.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...

随机推荐

  1. META 标签的使用

    <meta />标记详解 说明: meta是一个单边标签 ,主要功能:是用于设置或显示一些控制信息,告诉浏览器以什么编码显示. <meta>标记有两个主要的属性: http-e ...

  2. jQuery实现图片轮播

    之前有碰到过jQuery实现列表自动滚动,这次的图片轮播在原理上与之相同,只有一些细微的差别,就是需要在图片的右下角显示当前图片的序号,效果如下: 先看一看html代码,以及对应的css代码: < ...

  3. 3月3日(2) Search Insert Position

    这题...有点简单吧,为什么只有34%的通过率? 题目意思简单说就是查找index,或者按升序插入的未知,WA一次,罪过,下次要特别注意程序里变量的变化,提交前用样例检查. 简单的我有点不好意思贴代码 ...

  4. COM 学习小记录

    COM组件程序:模块,它可以是 动态连接库(DLL) && 可执行程序(EXE),称为 进程内组件(in-of-process component) && 进程外组件( ...

  5. 专家解说IT行业存在哪些安全风险

    本人为原创作品:e良师益友 ,转载是并且注明 网络带动了IT行业的发展,同时也带来了安全风险,国外的专家分析2014年IT行业存在的11个安全隐患,随着越来越多技术的不断开发,为方便人们记忆账号,产生 ...

  6. 看几道JQuery试题后总结(上篇)

    无意中拿到的JQuery题目,拿来分享顺便总结总结 在JQuery对象中区分.text();.val();.html();.innerHTML;.innerTEXT()的用法与区别,用例子证明 在JQ ...

  7. ios 数字禁止变成电话号码

    1.使用meta来限制页面不转换电话号码   <meta name="format-detection"content="telphone=no"/> ...

  8. js switch表达式的例子

    switch 这种表达式在很多语言中都有,比如java, C等待, 使用switch比使用if else 来得方便,来得清晰.  前言 switch 这种表达式在很多语言中都有,比如java, C等待 ...

  9. 符合web标准的网页下拉菜单

    <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"> <head> < ...

  10. container_of宏定义分析---linux内核

    问题:如何通过结构中的某个变量获取结构本身的指针??? 关于container_of宏定义在[include/linux/kernel.h]中:/*_** container_of - cast a ...