【android API】 ListView api 翻译

分享到:

ListView虽然常用,可是还没有系统的知道他。先从API开始吧。http://developer.android.com/reference/android/widget/ListView.html

略过summary了,直接进入xml attribute。

A.Xml Attribute。

1,android:divider

Drawable or color to draw between list items. 画在list的items之间的图片或颜色。

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".可以引用图片资源

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".可以使用颜色值。

This corresponds to the global attribute resource symbol divider.这相当于全局R.attr中的divider,其默认值:Constant Value: 16843049 (0x01010129)

2,android:dividerHeight

Height of the divider. Will use the intrinsic height of the divider if this is not specified.分割的高度。如果没有指明,那么使用默认的。

Must 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).必须使用浮点数,想14.5sp。可用的单位还有px,dp,sp,in,mm。

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.可以使用包含这类型值的资源引用。

This corresponds to the global attribute resource symbol dividerHeight.全局默认值:Constant Value: 16843050 (0x0101012a)

3,android:entries

Reference to an array resource that will populate the ListView. For static content, this is simpler than populating the ListView programmatically.

引用一个数组的资源,填入ListView。如果数组是固定的,那么在属性中使用比在程序中要简单。

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".必须以这种形式引用其他的资源。

This corresponds to the global attribute resource symbol entries.全局默认:Constant Value: 16842930 (0x010100b2)

4,android:footerDividersEnabled

When set to false, the ListView will not draw the divider before each footer view. The default value is true.如果值为false,那么ListView不会在footer view 展示前显示分割。默认为true。

Must be a boolean value, either "true" or "false".true,false二选一,没有其他值。

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.也可引用带有boolean值的资源。

This corresponds to the global attribute resource symbol footerDividersEnabled.全局默认:你懂的。

5,android:headerDividersEnabled  (翻译同4)

When set to false, the ListView will not draw the divider after each header view. The default value is true.

Must be a boolean value, either "true" or "false".

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.

This corresponds to the global attribute resource symbol headerDividersEnabled.

 

B.public constructors

public ListView (Context context) ; public ListView (Context context, AttributeSet attrs); 

public ListView (Context context, AttributeSet attrs, int defStyle)
昵    称:
验证码:

相关文档: