Android7.0中文API -- ListView
来源:互联网 发布:用户管理系统java 编辑:程序博客网 时间:2024/05/17 22:57
完整内容http://www.zhdoc.net/android/reference/android/widget/ListView.html
ListView
public class ListView
extendsAbsListView
A view that shows items in a vertically scrolling list. The items come from theListAdapter
associated with this view.
一个视图,其在垂直滚动的列表中显示项。这些项来自与此视图关联的ListAdapter
。
See the List View guide.
请参考List View。
摘要
嵌套类
class
ListView.FixedViewInfo
A class that represents a fixed view in a list, for example a header at the top or a footer at the bottom.
表现列表中一个固定的视图的类,例如顶部的页眉或者底部的页脚。
XML属性
android:divider
在列表项之间绘制的drawable或color。 android:divider
在列表项之间绘制的drawable或color。 android:dividerHeight
分隔栏的高度。 android:entries
对ListView的填充数组资源的引用。 android:footerDividersEnabled
设置为false时,ListView不会在每个footer view之前绘制分隔栏。 android:headerDividersEnabled
设置为false时,ListView不会在每个头部标题视图之前绘制分隔栏。 继承XML属性
android.widget.AbsListView
android.view.ViewGroup
android.view.View
继承常量
android.widget.AbsListView
android.widget.AdapterView
android.view.ViewGroup
android.view.View
继承字段
android.view.View
Public构造方法
ListView(Context context)
ListView(Context context, AttributeSet attrs)
ListView(Context context, AttributeSet attrs, int defStyleAttr)
ListView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public方法
void
addFooterView(View v, Object data, boolean isSelectable)
Add a fixed view to appear at the bottom of the list.
在列表的底部添加一个固定的视图。
void
addFooterView(View v)
Add a fixed view to appear at the bottom of the list.
在列表的底部添加一个固定的视图。
void
addHeaderView(View v, Object data, boolean isSelectable)
Add a fixed view to appear at the top of the list.
在列表的顶部添加一个固定的视图。
void
addHeaderView(View v)
Add a fixed view to appear at the top of the list.
在列表的顶部添加一个固定的视图。
boolean
areFooterDividersEnabled()
boolean
areHeaderDividersEnabled()
boolean
dispatchKeyEvent(KeyEvent event)
Dispatch a key event to the next view on the focus path.
向焦点路径上的下一个视图派发一个KeyEvent。
CharSequence
getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes.
返回此对象的类名,用于辅助功能目的。
ListAdapter
getAdapter()
Returns the adapter currently in use in this ListView.
返回此ListView中当前使用的适配器。
long[]
getCheckItemIds()
This method was deprecated in API level 8. Use getCheckedItemIds()
instead.
此方法在API level 8版本中被删除。用getCheckedItemIds()
来代替。
Drawable
getDivider()
Returns the drawable that will be drawn between each item in the list.
返回drawable,其在列表中每一项之间绘制。
int
getDividerHeight()
int
getFooterViewsCount()
Returns the number of footer views in the list.
返回列表中页脚视图的数量。
int
getHeaderViewsCount()
Returns the number of header views in the list.
返回列表中页眉视图的数量。
boolean
getItemsCanFocus()
int
getMaxScrollAmount()
Drawable
getOverscrollFooter()
Drawable
getOverscrollHeader()
boolean
isOpaque()
Indicates whether this View is opaque.
此视图是否不透明。
void
onInitializeAccessibilityNodeInfoForItem(View view, int position, AccessibilityNodeInfo info)
Initializes an AccessibilityNodeInfo
with information about a particular item in the list.
在列表中初始化一个AccessibilityNodeInfo
,其与特定项的信息有关。
boolean
onKeyDown(int keyCode,KeyEvent event)
Default implementation of KeyEvent.Callback.onKeyDown()
: perform press of the view whenKEYCODE_DPAD_CENTER
orKEYCODE_ENTER
is released, if the view is enabled and clickable.KeyEvent.Callback.onKeyDown()
的默认实现;如果view是使能的并且可点击,则当KEYCODE_DPAD_CENTER
或KEYCODE_ENTER
释放后,执行此视图的按键按下事件。
boolean
onKeyMultiple(int keyCode, int repeatCount,KeyEvent event)
Default implementation of KeyEvent.Callback.onKeyMultiple()
: always returns false (doesn't handle the event). KeyEvent.Callback.onKeyMultiple()
的默认实现;如果不处理事件,则始终返回false。
boolean
onKeyUp(int keyCode,KeyEvent event)
Default implementation of KeyEvent.Callback.onKeyUp()
: perform clicking of the view whenKEYCODE_DPAD_CENTER
,KEYCODE_ENTER
orKEYCODE_SPACE
is released.KeyEvent.Callback.onKeyUp()
的默认实现;当KEYCODE_DPAD_CENTER
,KEYCODE_ENTER
或KEYCODE_SPACE
释放后,执行此视图的点击事件。
boolean
removeFooterView(View v)
Removes a previously-added footer view.
删除之前添加的页脚视图。
boolean
removeHeaderView(View v)
Removes a previously-added header view.
删除之前添加的页眉视图。
boolean
requestChildRectangleOnScreen(View child, Rect rect, boolean immediate)
Called when a child of this group wants a particular rectangle to be positioned onto the screen.
当此组的子项希望将特定的矩形置于屏幕上时调用。
void
setAdapter(ListAdapter adapter)
Sets the data behind this ListView.
设置绑定此ListView的数据。
void
setCacheColorHint(int color)
When set to a non-zero value, the cache color hint indicates that this list is always drawn on top of a solid, single-color, opaque background.
当设置为非零值时,缓存颜色Hint表示该列表总是在一个纯色、单色、不透明的背景之上绘制。
void
setDivider(Drawable divider)
Sets the drawable that will be drawn between each item in the list.
设置drawable,其在列表中每一项之间绘制。
void
setDividerHeight(int height)
Sets the height of the divider that will be drawn between each item in the list.
设置分割栏的高度,其在列表中每一项之间绘制。
void
setFooterDividersEnabled(boolean footerDividersEnabled)
Enables or disables the drawing of the divider for footer views.
使能或禁用为页脚视图绘制分割栏。
void
setHeaderDividersEnabled(boolean headerDividersEnabled)
Enables or disables the drawing of the divider for header views.
使能或禁用为页眉视图绘制分割栏。
void
setItemsCanFocus(boolean itemsCanFocus)
Indicates that the views created by the ListAdapter can contain focusable items.
设置由ListAdapter创建的石头可以包含能获取焦点的项。
void
setOverscrollFooter(Drawable footer)
Sets the drawable that will be drawn below all other list content.
设置drawable,其绘制在所有其他列表内容下面。
void
setOverscrollHeader(Drawable header)
Sets the drawable that will be drawn above all other list content.
设置drawable,其绘制在所有其他列表内容上面。
void
setRemoteViewsAdapter(Intent intent)
Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService through the specified intent.
设置此AbsListView作为一个远程视图适配器使用,其通过指定的intent连接到RemoteViewsService。
void
setSelection(int position)
Sets the currently selected item.
设置当前已选择的项。
void
setSelectionAfterHeaderView()
setSelectionAfterHeaderView set the selection to be the first list item after the header views.
setSelectionAfterHeaderView方法将设置选择为页面视图之后的第一个列表项。
void
smoothScrollByOffset(int offset)
Smoothly scroll to the specified adapter position offset.
流畅地滚动到指定的适配器的位置偏移。
void
smoothScrollToPosition(int position)
Smoothly scroll to the specified adapter position.
流畅地滚动到指定的适配器的位置。
保护方法
完整内容http://www.zhdoc.net/android/reference/android/widget/ListView.html
- Android7.0中文API -- ListView
- Android7.0中文API---ImageButton
- Android7.0 中文API -- ZoomButton
- Android7.0中文API --- ImageView
- android7.0中文API -- LinearLayout
- Android7.0中文API -- TableLayout
- Android7.0中文API -- TableRow
- Android7.0中文API -- ZoomControls
- Android7.0中文API -- TabWidget
- Android7.0中文API -- ActionMenuView
- Android7.0中文API -- RadioGroup
- Android7.0中文API -- SearchView
- Android7.0中文API -- SeekBar
- Android7.0中文API -- ProgressBar
- Android7.0中文API --- AbsSeekBar
- Android7.0中文API -- RatingBar
- Android7.0中文API -- Spinner
- Android7.0中文API -- AbsSpinner
- 使用jquery实现动态加载片段
- JAVA-20-数据约束、数据库设计三大范式、多表查询、存储过程、触发器、数据库权限
- 1-1 Linux系统安装
- 侦察兵
- BlockManager初始化和注册解密、BlockManagerMaster工作解密、BlockTransferService解密、本地数据读写解密、远程数据读写解密
- Android7.0中文API -- ListView
- HDU4982 Goffi and Squary Partition
- 常用的windows注册表大全
- Java对日期Date类型进行运算
- SSH 公钥免密码登陆
- POJ 1786 Bridge Hands 笔记
- JAVA-21-JDBC讲解,Driver、Connection、Statement、PreparedStatement、CallableStatement、ResultSet
- 513. Find Bottom Left Tree Value
- C++算法学习——经典的抽象设计——buffer(1)