开发者

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

开发者 https://www.devze.com 2023-01-27 12:33 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消