gpt4 book ai didi

ios - 向左滑动 View Controller 到动态 View

转载 作者:行者123 更新时间:2023-11-28 16:16:17 24 4
gpt4 key购买 nike

我目前正在构建一个应用程序,它需要能够向左滑动到下一个 View Controller ,然后从字典中动态显示随机引号。我已经从初始 View Controller 添加了当前手势识别器,但是我不想要标准的推送转场功能。

它应该如何运作:从向左滑动,您将滑动到下一个 View Controller 。从这个 View Controller 我可以使用 ScrollView 。我可以根据字典的计数生成动态 subview 还是有其他东西。

当前手势识别器:

  let swipeLeft = UISwipeGestureRecognizer(target: self, action: "goSwipe:")
swipeLeft.direction = .Left
self.view.addGestureRecognizer(swipeLeft)

我希望能够在初始 View Controller 上向左滑动到下一个(应用程序中只有 2 个 VC)。

谢谢

最佳答案

您可以通过设置其contentSize方法x位置来使用水平scrollview,然后根据字典的计数生成动态 subview 。

检查一下 here .

关于ios - 向左滑动 View Controller 到动态 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39034498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com