Android的ExpandableListView - 寻找一个教程 [英] Android ExpandableListView - Looking for a tutorial
问题描述
我想编写一个Android界面,使用侧面的可扩展列表,并在另一侧的片段,所以我可以通过点击扩展列表的孩子加载不同的资源。但不幸的是,我不能找到有关这个列表中的任何好的教程任何地方。是的,我已经看在API的演示,我做了一个正常的列表与BaseExpandableListAdapter但仍,了解这些列表以及它还挺辛苦没有一个很好的教程,你有什么好的周围或信息,我可以检查?
I'm trying to program an Android interface which uses an expandable list on the side and a fragment on the other side so I can load different resources by clicking on the children of the expandable list. But unfortunately I cannot find any good tutorials about this list anywhere. Yes I've look in the API demos and I've made a normal list with a BaseExpandableListAdapter but still, understanding those list well it's kinda hard without a good tutorial, do you have any good one around or info I could check?
推荐答案
你可以找到可扩展列表视图的工作例如,通过以下链接:
you can find working example of the expandable list view by following links:
-
<一个href="http://developer.android.com/reference/android/widget/ExpandableListView.html">ExpandableListView
<一个href="http://www.$c$crzheaven.com/expandable-listview-android-simpleexpandablelistadapter-simple-example/">Expandable ListView控件在ANDROID
<一个href="http://androidtrainningcenter.blogspot.in/2012/07/android-expandable-listview-simple.html">Android可扩展的ListView简单的例子中的机器人。
有关点击的孩子,你可以处理这种方式。
for click on child, you can handle this way.
getExpandableListView().setOnChildClickListener(new OnChildClickListener() {
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// your code...
}
});
希望这会帮助你。 谢谢..
Hope this will help you. Thanks..
这篇关于Android的ExpandableListView - 寻找一个教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!