Instagram style multimedia listview

别等时光非礼了梦想. 提交于 2019-12-11 02:24:01

问题


I've tried searching but not found a definitive answer. I would like to know the best way to create a listview that can display either audio/video view items with a media controller that the user can play/pause etc for each item. I assume implementing a texture view would be the way forward (i believe videoview doesn't play nice with scrollviews) but i'm not sure where to go from there.


回答1:


So, I have not actually tried this myself, however I will give you my idea either way.

I would populate the listview using two different views. One for images, and another for video. Then in your adapter/Java code you would need to add a statement determining which view you would like to use to populate the listview with.

For example, you have two xml files:

videolistview.xml

imagelistview.xml

in your MainActivity.java file, you would alter your adapter to determine which file to reference in order to populate the listview.

Hopefully that made sense.



来源:https://stackoverflow.com/questions/25982935/instagram-style-multimedia-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!