问题
I want to build a custom gallery.
a 2d Dimension gallery , user can swiping page vertical and horizontal.
i store information like a 2d map, each page have its x and y coordinate.
========================
like first page is (0,0)
upper of first page is (0,-1)
second page is (1,0)
========================
if upper of first page swiping right , then will go second page.
but i don't know how do i go forward.
Thanks
-- update -- more detail what i want.
originally gallery only have left and right swiping. user see photo by swiping left or right.
now user not only swiping left or right, but also swiping up and down to see the photo.
data structure is, each page have own x and y coordinate.
回答1:
It is very hard to give an answer for this - you mention no programming language nor more specifics of what it is you want to do.
I guess it depends on where you want this gallery - one solution could be to make it webbased - while this is a sidescroller and I am planning to use the top buttons to change the page you should think about it...
http://globability.org/webapp/androidtest_20111105_1.html
It is a rough prototype - scrolling sideways on the Android with buttons following top and bottom.
I am not sure how you'd go about the automatic changing of pages whether you should create a button boundry, or set some sort of a listener that follows the x,y coordinates in the visible viewport and set event listeners that are triggered when the visible area reaches specific coordinates, use a different layout than me off course - but it all depends on the programming language - the example is plain old HTML but you get the idea, and the listener thing for x/y in visible viewport should be valid for most modern programming languages.
how to overlap a horizontal gallery with a vertical gallery - has some ideas for how to create similar functionality
来源:https://stackoverflow.com/questions/8346108/android-how-to-build-a-2d-dimension-gallery-with-vertical-and-horizontal-swipi