如何在iPhone应用程序中通过滑动手势水平滑动视图?

发布于 2024-10-04 02:07:33 字数 152 浏览 0 评论 0原文

在我的 iPhone 应用程序中,我希望用户可以通过滑动手势滑动视图。

我希望在滑动手势时,视图应该水平滑动,就好像所有视图都缝合在一起一样。

这应该是一个平稳的观点运动。

我应该怎么办?

请帮助和建议

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

终止放荡 2024-10-11 02:07:33

在我看来,您应该添加一个 UIScrollView 作为您的父视图,并将这些其他视图添加为滚动视图的子视图,并在需要的位置设置它们的 x 偏移量让它们“缝合在一起”。您可以免费获得水平滚动,并且一切都会按照您的预期进行。

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.

我恋#小黄人 2024-10-11 02:07:33

您还可以设置一个 NavigationController 将视图推送到堆栈或将视图弹出到堆栈。然后在你的 viewController 中你可以添加手势。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文