Android7.0中文文档(API)--- ExpandableListView
2017-06-14 12:09
531 查看
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/ExpandableListView.html
ExpandableListView
public class ExpandableListView
extends ListView
java.lang.Object | ||||||
↳ | android.view.View | |||||
↳ | android.view.ViewGroup | |||||
↳ | android.widget.AdapterView<android.widget.ListAdapter> | |||||
↳ | android.widget.AbsListView | |||||
↳ | android.widget.ListView | |||||
↳ | android.widget.ExpandableListView |
ListViewby allowing two levels: groups which can individually be expanded to show its children. The items come from the
ExpandableListAdapterassociated with this view.
一个视图,其在垂直滚动2个层次的列表中显示项。这个类与
ListView不同,它允许显示2个层级:组项可以被单独地展开,以显示子项。这些项来自与此视图关联的
ExpandableListAdapter。
Expandable lists are able to show an indicator beside each item to display the item's current state (the states are usually one of expanded group, collapsed group, child, or last child). Use
setChildIndicator(Drawable)or
setGroupIndicator(Drawable)(or the corresponding XML attributes) to set these
indicators (see the docs for each method to see additional state that each Drawable can have). The default style for an
ExpandableListViewprovides indicators which will be shown next to Views given to the
ExpandableListView. The layouts android.R.layout.simple_expandable_list_item_1 and android.R.layout.simple_expandable_list_item_2 (which
should be used with
SimpleCursorTreeAdapter) contain the preferred position information for indicators.
可扩展的列表可以在每个项目旁边显示一个指示器来显示项目的当前状态(状态通常是这些之一:已展开的组项,已折叠的组项,子项,或最后一个子项)。使用
setChildIndicator(Drawable)或
setChildIndicator(Drawable)(或者对应的XML属性),来设置在这些指示器(请参考每个方法的文档,以查看每个drawable拥有的额外状态)。
ExpandableListView的默认样式提供了一些指示器,这些指示器显示在
ExpandableListView视图的旁边。android.R.layout.simple_expandable_list_item_1或android.R.layout.simple_expandable_list_item_2(使用
SimpleCursorTreeAdapter)布局包含用于指示器的首选位置信息。
The context menu information set by an
ExpandableListViewwill be a
ExpandableListView.ExpandableListContextMenuInfoobject with
packedPositionbeing a packed position that can be used with
getPackedPositionType(long)and the other similar methods.
由
ExpandableListView是设置的上下文菜单的信息是一个
ExpandableListView.ExpandableListContextMenuInfo对象,其包含
packedPosition字段作为一个包装位置,可以给
getPackedPositionType(long)和其他类似的方法使用。
Note: You cannot use the value
wrap_contentfor the
android:layout_heightattribute of a ExpandableListView in XML if the parent's size is also not strictly specified (for example, if the parent were ScrollView you could not specify wrap_content since it also can be any length. However, you can
use wrap_content if the ExpandableListView parent has a specific size, such as 100 pixels.
注意:如果父项的大小也没有被严格地指定,则你不能在XML中给ExpandableListView的
android:layout_height属性赋予
wrap_content的值。(例如,父项是ScrollView,则你不能指定wrap_content,因为它也可以是任意长度。)但是,如果ExpandableListView的父项是指定了大小,如100像素,则你可以使用wrap_content。
摘要
嵌套类 | |
---|---|
class | ExpandableListView.ExpandableListContextMenuInfo Extra menu information specific to an ExpandableListViewprovided to the onCreateContextMenu(ContextMenu, View, ContextMenuInfo)callback when a context menu is brought up for this AdapterView. 当为这个AdapterView弹出一个上下文菜单时,提供给 onCreateContextMenu(ContextMenu, View, ContextMenuInfo)方法的额外的菜单信息。 |
interface | ExpandableListView.OnChildClickListener Interface definition for a callback to be invoked when a child in this expandable list has been clicked. 回调的接口定义,当此可扩展列表内的一个子项被点击时调用。 |
interface | ExpandableListView.OnGroupClickListener Interface definition for a callback to be invoked when a group in this expandable list has been clicked. 回调的接口定义,当此可扩展列表内的一个组项被点击时调用。 |
interface | ExpandableListView.OnGroupCollapseListener Used for being notified when a group is collapsed 用于当组项折叠时的通知。 |
interface | ExpandableListView.OnGroupExpandListener Used for being notified when a group is expanded 用于当组项展开时的通知。 |
XML属性
相关文章推荐
- Android7.0中文文档(API)-- AbsListView.LayoutParams
- Android7.0中文文档(API)-- AbsListView.OnScrollListener
- Android7.0中文文档(API)-- AbsListView.SelectionBoundsAdjuster
- Android7.0中文文档(API)-- SimpleExpandableListAdapter
- Android7.0中文文档(API)-- AbsListView
- Android7.0中文文档(API)--- BaseExpandableListAdapter
- Android7.0中文文档(API)-- AbsListView.MultiChoiceModeListener
- Android7.0中文文档(API) -- AbsListView.RecyclerListener
- Android7.0中文文档(API)-- ExpandableListAdapter
- android7.0中文文档(API)-- HeterogeneousExpandableList
- Android7.0中文文档(API) --- MediaController
- Android7.0中文文档(API) --- RadioButton
- Android7.0中文文档(API) --- Button
- Android7.0中文文档(API)--- AdapterView
- Android7.0中文文档(API)--- ImageSwticher
- Android7.0中文文档(API)-- TextSwitcher
- Android7.0中文文档(API)--- ViewFlipper
- Android7.0中文文档(API)--- MultiAutoCompleteTextView
- Android7.0中文文档(API)-- AutoCompleteTextView.OnDismissListener
- Android7.0中文文档(API)-- BaseAdapter