简体   繁体   中英

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

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.

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

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. While viewpager has its own PagerAdapter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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