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

标签 ios iphone swift segue

我目前正在构建一个应用程序,它需要能够向左滑动到下一个 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/

相关文章:

IOS/objective-C : Retrieve NSArray from completion block

iphone - 有没有办法让文本字段条目必须是电子邮件? (在 xcode 中)

iphone - iOS 每天在特定时间触发本地通知

iphone - 定时器模式下的 DatePicker - 如何获取值

swift - 数组完成后执行函数 - Swift

ios - 加载表格时 tableView outlet nil

ios - 在 iOS 中重写推送通知内容

ios - 如何为约束获取随机 CGFloat?

swift - 将长月份名称转换为 int

swift - 如何访问 firestore (swift) 中返回的查询结果?