什么是当你不指定表布局中的元素高度和宽度的默认值? [英] What are the default values when you don't specify height and width for elements inside a table layout?

查看:144
本文介绍了什么是当你不指定表布局中的元素高度和宽度的默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,与表的布局时,你不必指定layout_width和layout_height对里面的元素。(不弹出一个编译器(不知道它的编译器),或者布局错误)。也就是说,它是完全有效的是这样的一个表格布局内

I noticed that when working with a table layout, you don't have to specify layout_width and layout_height for elements inside it.(doesn't bring up a compiler(not sure if its a compiler) or a layout error). That is, it is perfectly valid to have something like this inside a table layout

    <TableRow
    android:id="@+id/tableRow3"
    android:padding="@dimen/activity_horizontal_margin" >

我假定表布局给出的默认值宽度和高度。有谁知道这些值?我试着在谷歌和这里其他线程看这件事,但找不到任何东西。

I assuming that the table layout gives default values for width and height. Does anyone know what these values are? I tried looking this up on google and on other threads here but couldn't find anything.

推荐答案

您的例子并不只是有效的,它会忽略宽度和高度。

Your example is not just valid, it would ignore width and height.

一TableLayout的孩子不能指定layout_width属性宽度始终MATCH_PARENT然而,layout_height属性可以通过一个孩子来定义;默认值是WRAP_CONTENT如果孩子通过tablerow,那么高度总是WRAP_CONTENT。 。

"The children of a TableLayout cannot specify the layout_width attribute. Width is always MATCH_PARENT. However, the layout_height attribute can be defined by a child; default value is WRAP_CONTENT. If the child is a TableRow, then the height is always WRAP_CONTENT."

您真的应该在这个网站更经常看
http://developer.android.com/reference/android/widget/TableLayout.html

You really should look more often at this site http://developer.android.com/reference/android/widget/TableLayout.html

这篇关于什么是当你不指定表布局中的元素高度和宽度的默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆