简体   繁体   中英

How to horizontally slide views on swipe gesture in iPhone app?

In my iPhone app, I want that the user can slide views on swipe gesture.

I want that on swipe gesture the views should horizontally slide as if all the views are stitched together.

It should be a smooth motion of views.

What should I do?

Please Help and Suggest

Thanks.

Sounds to me like you should be adding a UIScrollView as your parent view, and adding these other views as subviews of the scroll view, setting their x offsets where they need to be to have them "stiched together". You get the horizontal scrolling for free, and things work as you'd expect.

You can also set up a NavigationController to push and pop views to the stack. Then in your viewController you can add gestures.

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