我在XML的定义里也没有找到,但是在R.attr找到了定义。打开Android Help html,点击左上角的Class Index,在主界面的: A B C D E F G H I J K L M N O P Q R S T U V W X Z 中点击R 选择第四个R.attr(这个类我想是包括了所有的属性了)。 进入R.attr后,Ctrl + F查找layout_heigth和layaout_width就可以找到了。public static final int layout_height Since: API Level 1 Specifies the basic height of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant height or one of the special constants. May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type. May be one of the following constant values.Constant Value Description fill_parent -1 The view should be as big as its parent (minus padding). wrap_content -2 The view should be only big enough to enclose its content (plus padding). Constant Value: 16842997 (0x010100f5) public static final int layout_width Since: API Level 1 Specifies the basic width of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant width or one of the special constants. May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type. May be one of the following constant values.Constant Value Description fill_parent -1 The view should be as big as its parent (minus padding). wrap_content -2 The view should be only big enough to enclose its content (plus padding). Constant Value: 16842996 (0x010100f4)
(2)android:padding="20";
1依然没找到,view和textview都找过了,只在listview中找到android:width和android:height
A B C D E F G H I J K L M N O P Q R S T U V W X Z
中点击R
选择第四个R.attr(这个类我想是包括了所有的属性了)。
进入R.attr后,Ctrl + F查找layout_heigth和layaout_width就可以找到了。public static final int layout_height
Since: API Level 1 Specifies the basic height of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant height or one of the special constants. May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type. May be one of the following constant values.Constant Value Description
fill_parent -1 The view should be as big as its parent (minus padding).
wrap_content -2 The view should be only big enough to enclose its content (plus padding).
Constant Value: 16842997 (0x010100f5)
public static final int layout_width
Since: API Level 1 Specifies the basic width of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant width or one of the special constants. May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type. May be one of the following constant values.Constant Value Description
fill_parent -1 The view should be as big as its parent (minus padding).
wrap_content -2 The view should be only big enough to enclose its content (plus padding).
Constant Value: 16842996 (0x010100f4)
一个叫layout,一个叫*.xml layout是xml的界面表示,就象C#一样,直观的,也可以再那里直接拖界面
在那里面选中一个控件,下面就有一栏属性框,在里面可以设置那个控件所有的属性,设置了以后会在xml文件里面自动生成代码另外,那些属性要么在对应的类里面,要么在其父类里面
比如layout_width可以在SDK的
file:///E:/android-sdk-windows-1.5_r1/docs/reference/android/widget/TextView.html#inhattrs
下找一找,应该有
E:/android-sdk-windows-1.5_r1/是你SDK的安装目录
Android有个工程文件夹是gen,里面有个自动生成的R.java,我想这个R.attr是为这个R.java文件服务的。