Instagram的风格多媒体列表视图 [英] Instagram style multimedia listview

查看:162
本文介绍了Instagram的风格多媒体列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过寻找,但没有找到一个明确的答案。我想知道,以创建可显示与媒体控制器,用户可以播放/暂停等,为每个项目无论是音频/视频查看项目列表视图的最佳途径。我想实现一个纹理视图将是前进的方向(我相信videoview不玩scrollviews不错),但我不知道从哪里里去。

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.

推荐答案

所以,我没有其实这个我试过,但我会给你我的想法两种方式。

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

我会用填充两种不同的视图列表视图。一个用于图像和另一个用于视频。然后在你的适配器/ Java的code,你需要添加一份声明中确定哪些查看您想使用来填充列表视图。

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.

例如,你有两个XML文件:

For example, you have two xml files:

videolistview.xml

imagelistview.xml

MainActivity.java 文件,你会改变你的适配器来确定,以填充列表视图引用的文件。

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

希望这是有道理的。

这篇关于Instagram的风格多媒体列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆