문제

I'm looking to create a carousel that snaps to whatever page covers most of the screen after a swipe, similar to how swipes can move through pages of android shortcuts and widgets. Similar to this. Each page should be able to display any assortment of layouts, data, or pictures.

I have looked at the resources on the "Creating an Android Image Carousel" page by Giancarlo Leonio. However, most questions are unanswered or do not apply to android.

I have seen tutorials with a viewpager, but they immediately switch pages after a swipe. I prefer that the pages appear to be connected.

도움이 되었습니까?

해결책

You are looking for ViewPager. I don't know where you found these tutorials that lead you to believe that the interactions would appear that the pages are not interconnected.

You can find a good tutorial and demo transitions on the official documentation: http://developer.android.com/training/animation/screen-slide.html

Additionally, if you also want the indicators that Carousels would normally have you can take a look at the most popular library out there for ViewPagers...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top