This TableLayout layout or its LinearLayout parent is possibly useless
<?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="vertical" > <!-- 定义第一个表格布局,指定第2列允许收缩,第3列允许拉伸 --> <TableLayout
android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="1"
android:stretchColumns="2" > <!-- 直接添加按钮,它自己会占一行 --> <Button
android:id="@+id/ok1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="独自一行的按钮" />
<!-- 添加一个表格行 --> <TableRow> <!-- 为该表格行添加3个按钮 --> <Button
android:id="@+id/ok2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="普通按钮" /> <Button
android:id="@+id/ok3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收缩的按钮" /> <Button
android:id="@+id/ok4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="拉伸的按钮" />
</TableRow>
</TableLayout> </LinearLayout>
上述LinearLayout中只有一个TableLayout,在<TableLayout处有警告信息:This TableLayout layout or its LinearLayout parent is possibly useless
下面的LinearLayout中有两个TableLayout就没有这种警告信息:
<?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="vertical" > <!-- 定义第一个表格布局,指定第2列允许收缩,第3列允许拉伸 --> <TableLayout
android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="1"
android:stretchColumns="2" > <!-- 直接添加按钮,它自己会占一行 --> <Button
android:id="@+id/ok1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="独自一行的按钮" />
<!-- 添加一个表格行 --> <TableRow> <!-- 为该表格行添加3个按钮 --> <Button
android:id="@+id/ok2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="普通按钮" /> <Button
android:id="@+id/ok3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收缩的按钮" /> <Button
android:id="@+id/ok4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="拉伸的按钮" />
</TableRow>
</TableLayout> <TableLayout
android:id="@+id/TableLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:collapseColumns="1" > <!-- 直接添加按钮,它自己会占一行 --> <Button
android:id="@+id/ok5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 独自一行的按钮 " />
<!-- 定义一个表格行 --> <TableRow> <!-- 为该表格行添加3个按钮 --> <Button
android:id="@+id/ok6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="普通按钮1" /> <Button
android:id="@+id/ok7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="被隐藏的按钮" /> <Button
android:id="@+id/ok8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="普通按钮 3" />
</TableRow>
</TableLayout> </LinearLayout>
This TableLayout layout or its LinearLayout parent is possibly useless的更多相关文章
- Waring:This LinearLayout layout or its FrameLayout parent is useless; transfer the background attribute to the other view
解决方法请参考: You have a single component (row) vertical linear layout, containing another linear layout. ...
- Android性能优化方法(八)
Android SDK tools目录下提供一个观察布局的工具,层级观察器(Hierarchy Viewer).Hierarchy Viewer工具是一个非常好的布局优化工具,同时,你也可以通过它学习 ...
- 教你使用Android SDK布局优化工具layoutopt
创建好看的Android布局是个不小的挑战,当你花了数小时调整好它们适应多种设备后,你通常不想再重新调整,但笨重的嵌套布局效率往往非常低下,幸运的是,在Android SDK中有一个工具可以帮助你优化 ...
- Android:一个高效的UI才是一个拉风的UI(二)
趁今晚老大不在偷偷早下班,所以有时间继续跟大伙扯扯UI设计之痛,也算一个是对上篇<Android:一个高效的UI才是一个拉风的UI(一)>的完整补充吧.写得不好的话大家尽管拍砖~(来!砸死 ...
- 22、DDMS(转载)
本文是转载,出处为http://www.xuebuyuan.com/1291595.html 如需删除本文,请私信我,谢谢 DDMS DDMS是一款Google* 提供的应用,可作为独立的工具运行,也 ...
- 利用Hierarchy Viewer优化布局
好久没更新博客了,趁着清明来写点什么. 今天来讲下如何使用android中提供的工具优化我们的布局.首先我们写一个最简单的框架布局. <?xml version="1.0" ...
- 调试 Android* x86 应用程序的方法以及要使用的工具
作者:Xiaodong Wang 1.简单介绍 众所周知,Android* 开发者头顶很多称呼:设计员.程序员等,而且一般会不可避免地被称为故障检修工. 代码中的错误无法避免.因此不管您是否一開始就造 ...
- 【转】Pro Android学习笔记(二五):用户界面和控制(13):LinearLayout和TableLayout
目录(?)[-] 布局Layout 线性布局LinearLayout 表格布局TableLayout 布局Layout Layout是容器,用于对所包含的view进行布局.layout是view的子类 ...
- 寒假学干货之------LinearLayout.layout.weight
所有原始代码由这个大神写的--http://www.cnblogs.com/zhangs1986/archive/2013/01/17/2864237.html layout/activity_mai ...
随机推荐
- phpMyAdmin的配置
好久没写东西了,上来记录一下今天学的一点小东西吧~ 之前搞php开发的时候,一直用的是SQLyog来操作mysql数据库的,但是今天发现sqlyog功能不是很完善,主要是我想修改数据库名,但是sqly ...
- 在ubuntu 14.04上安装2.6的内核
1.到http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.tar.bz2这里下载最新的稳定版内核: 2.根据各自系统,安装如下软件:l b ...
- HDFS体系架构
Master-slaver结构,namenode是中心服务器维护着文件系统树和整个树内的文件目录, 负责整个数据集群的管理.datanode分布在不同的机架上,在客户端和namenode的调度下 存储 ...
- RabbitMQ 开启WEB管理
rabbitmq-plugins 插件管理器 1.开启rabbitmq management - WEB管理插件 # rabbitmq-plugins enable rabbitmq_manage ...
- Hive数据仓库
Hive 是一个基于Hadoop分布式文件系统(HDFS)之上的数据仓库架构,同时依赖于MapReduce.适用于大数据集的批处理,而不适用于低延迟快速查询. Hive将用户的HiveQL语句转换为M ...
- 解决iphone5s,iphone6不能使用luajit及luac的问题
做手游有小段时间了,感觉坤哥给这么多的机会.一直都比较忙项目的事,比较没时间去写点东西做点记录.想想还是写点开发问题记录比较好,可以很简短,也可以很有用. 我们项目采用的cocos2d-x的引擎,之前 ...
- 易货beta版本项目展示报告
一.团队成员和个人博客地址 PM:刘猛 开发人员:胡亚坤,董元财 测试人员:马汉虎,赖彦谕 团队名:bestRW 团队博客地址:http://www.cnblogs.com/niceRW/ 董元财:h ...
- 冰球项目日志4-yjw
小组讨论 我们组编程主要分成三个模块,各自负责自己的编程与测试. 杨静梧:确定击球算法编程.输入:冰球位置,速度大小方向:输出:撞击时冰球中心位置. 曹迦勒:确定击球手速度,位置.输入:撞击时冰球中心 ...
- hibernate hql
hibernate在使用hql进行select count(*) from ObjectA left join fetch apath 时会报错,多余的left join去掉即可.
- 【转】 如何使用Valgrind memcheck工具进行C/C++的内存泄漏检测
系统编程中一个重要的方面就是有效地处理与内存相关的问题.你的工作越接近系统,你就需要面对越多的内存问题.有时这些问题非常琐碎,而更多时候它会演变成一个调试内存问题的恶梦.所以,在实践中会用到很多工具来 ...