简体   繁体   English

是否可以在ExpandableListView中为子项放置不同的布局?

[英]it is possible to put different layouts for child items in ExpandableListView?

I'm a new developer with android and I'm trying to put different layouts for child items in Expandable List View but I can't found the complete tutorial to do this so if is possible to do this, please help with a link for a good tutorial or a simple code source for this type of Expandable List View. 我是android的新开发人员,我试图在“可扩展列表视图”中为子项放置不同的布局,但我找不到完整的教程来执行此操作,因此,如果有可能,请提供以下链接的帮助这种可扩展列表视图的不错的教程或简单的代码源。 thanks 谢谢

http://www.techiecommunity.net/Android/Android-ExpandableListView-Layout-示例本教程可以解决我的问题中提到的问题,但是我仍然遇到问题,因为我的类可扩展ListFragment,并且在此示例中扩展ExpandableListActivity,因此是一个解决方案?

Just don't extend ExpandableListActivity . 只是不要扩展ExpandableListActivity I also extends a Fragment and it works fine. 我还扩展了一个Fragment ,它工作正常。

Then use the correct method : 然后使用正确的方法:

((ExpandableListView) getView().findViewById( R.id.list).setAdapter( m_expandableListAdapter);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM