ANDROID_MARS学习笔记_S01_007Linear_layout嵌套与layout_weight的设置
一、介绍

二、
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的设置的更多相关文章
- 【转】 树莓派学习笔记——I2C设备载入和速率设置
原文网址:http://blog.csdn.net/xukai871105/article/details/18234075 1.载入设备 方法1——临时载入设备 sudo modprobe -r i ...
- 树莓派学习笔记——I2C设备载入和速率设置
原文:http://blog.csdn.net/xukai871105/article/details/18234075 1.载入设备 方法1——临时载入设备 sudo modprobe -r i2c ...
- ANDROID_MARS学习笔记_S01_008Linear_layout例子
1.netstone_layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLay ...
- ANDROID_MARS学习笔记_S02_004_ExpandableListActivity
1.main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" x ...
- Python学习笔记--gevent嵌套使用
这篇主要是接着上篇的,实验gevent嵌套使用,看情况如何.还是先上代码. #!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-0 ...
- ANDROID_MARS学习笔记_S01_012_RatingBar
1.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...
- ANDROID_MARS学习笔记_S01_012_SeekBar
1.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...
- ANDROID_MARS学习笔记_S01_011ProgressBar
文档是这样来设置样式 <ProgressBar android:layout_width="wrap_content" android:layout_height=" ...
- ANDROID_MARS学习笔记_S01_010日期时间控件
1.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...
随机推荐
- javascript笔记——闭包
花了三天时间,终于弄清楚闭包的各种写法和注意的事项,以及以前写,经常出错的地方,特此做一个总结,虽然不够专业,但是对于那些初学者来说,绝对对闭包的理解事半功倍. 案例一: function aa(){ ...
- H5API——Canvas
http://item.jd.com/11241807.html HTML5移动Web开发实战http://item.jd.com/10982275.html HTML5程序设计(第2版)http:/ ...
- UVALive 3027(并查集)
题意:某公司的各企业群要建立联系,I i j 表示企业i与企业j建立联系,并且以企业j为中心(并查集中的父亲)(企业j为暂时的中心企业),E i 表示查询企业 i 距离此时的中心企业的距离.各企业间的 ...
- PerformSelector may cause a leak because its selector is unknown 解决方法
我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3801030.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...
- Qt自定义菜单项
经常会看到一些菜单的部分项是由几个按钮组成的,如酷狗.QQ.360都有类似菜单,对于常规的菜单项,图标 + 文字 实现一个事件,很容易完成,那么怎么自定义菜单项呢? Qt提供了支持,就是利用QWidg ...
- Excel加载期间出现问题 解决方案
今天在处理Excle表格的时候出现了如图所示的问题,资料比较重要,需要进行恢复: 出现问题的原因就是在制作的时候,产生了某些临时的htm文件,但是只保留了excel,将那些临时文 ...
- L002-oldboy-mysql-dba-lesson02
L002-oldboy-mysql-dba-lesson02 [root@web01 ~]# mysql -uroot -ptestpassword mysql> use mys ...
- CMakeLists实战解读--YouCompleteMe
原文转载自:Ricky.K http://www.cnblogs.com/rickyk/p/3877238.html 个人一直有一个想法,就是想出一系列关于CMakeLists.txt国外经典例子的实 ...
- shadow服务端、客户端配置流程
服务端 系统环境 CentOS 7 64位,由于系统自带python,shadowsocks服务端我们选择python版,过程如下 yum install python-setuptools & ...
- gulp 不是内部或者外部命令 或者 webpack 不是内部或者外部命令
gulp安装也正常,但是就是查看gulp -v的时候报错,原因:缺少系统变量PATH或者PATH变量错误 提示:这个系统变量PATH,直接追加就好(多个变量值用分号;隔开),不要删除已经有的系统变量P ...