Android Multiple Views
I am trying to make an app that will have multiple screens, and I want to be able to swipe left and right to go 开发者_Python百科back and forth from screen to screen. Basically like how you go through pi ctures in the gallery, but mine won't just be pictures. Any tutorials or a suggestion on what type layout I should use.. TIA
Try HorizontalScrollView. If you want it to snap, you will probably have to write some code that sets the position of the scrollview correctly either on up touchevents, and/or intercepting those events to a GestureDetector with SimpleOnGestureListener to catch flings specifically.
You can have this effect using ViewFlipper...
http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/
You need to apply gestures. This link could help you which explains the same you need:
http://www.anddev.org/view-layout-resource-problems-f27/swipe-fling-to-switch-between-activities-t15602.html
You can try using a Gallery View with an adapter that returns the views you want to scroll with. But it's going to be a pain laying out the views...
You can do something like the launch screen has.
http://blog.velir.com/index.php/2010/11/17/android-snapping-horizontal-scroll/
also:
Flingable Tab Host
also:
Android Snapping HorizontalScrollView
and finally:
Horizontal Pager
精彩评论