问题
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