简体   繁体   English

Viewpager从Arraylist动态地

[英]Viewpager dynamically from Arraylist

I've got a little problem; 我有一个小问题。

I've been searching for something like a horizontal listview, the almost perfect I found was the Gallery, I even got it working. 我一直在寻找类似水平列表视图的东西,我发现最完美的是画廊,我什至可以使它正常工作。 Thing is: it's too old :P 问题是:它太旧了:P

Now I found a perfect replacement the "Viewpager", but I can't seem to find a way to use something like an Arrayadapter to fill the Viewpager like a listview. 现在,我找到了“ Viewpager”的完美替代品,但是我似乎找不到一种使用Arrayadapter之类的方法来填充Listpage之类的Viewpager的方法。

Can someone help me with an example or give me something else I should use? 有人可以帮我举一个例子,或者给我我应该使用的其他东西吗?

Thanks in advance ;) 提前致谢 ;)

Check this out: http://spacetech.dk/android-viewpager-with-listview-pages.html 检查一下: http : //spacetech.dk/android-viewpager-with-listview-pages.html

Only thing left to do is to replace in your layout this: 剩下要做的就是替换布局:

android:orientation="vertical"

with this: 有了这个:

android:orientation="horizontal"

Hope this helped. 希望这会有所帮助。

Two Way Gridview https://github.com/jess-anders/two-way-gridview the easiest. 双向网格视图https://github.com/jess-anders/two-way-gridview最简单。 While viewpager has its own PagerAdapter 虽然viewpager有自己的PagerAdapter

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

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