简体   繁体   English

Swift 4.2:如何在 ViewController 中嵌入 UIPageControl(没有 Storyboard)?

[英]Swift 4.2: How to embed UIPageControl in ViewController (without Storyboard)?

Does anyone have an example of how to embed a PageController within a ViewController without using a xib or storyboard?有没有人有如何在不使用xib或故事板的情况下在ViewController嵌入PageController的示例?

Is using a UIPageControl the right approach to build the following?使用UIPageControl是构建以下内容的正确方法吗?

在此处输入图片说明

The standard technique is along these lines:标准技术是这样的:

    let pvc = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal)
    self.addChild(pvc)
    self.view.addSubview(pvc.view)
    pvc.view.frame = // whatever
    pvc.didMove(toParent: self)
    pvc.setViewControllers( //...
    pvc.dataSource = // ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 swift 4.2 如何在没有故事板的情况下进入主页? - how to go to home page without storyboard by swift 4.2? 如何在 Storyboard 中将 ViewController.swift 连接到 ViewController? - How to connect ViewController.swift to ViewController in Storyboard? 目前ViewController Segue Transition没有故事板[Swift] - Present ViewController Segue Transition Without Storyboard [Swift] 如何在不使用Swift的ios中使用Storyboard的情况下将tableViewCell的数据共享到下一个viewController - How to share data of tableViewCell to next viewController without using storyboard in ios with Swift Swift 5. 如何在按钮触摸时呈现或显示 ViewController? 没有故事板(以编程方式) - Swift 5. How present or show ViewController on button touch? Without Storyboard (programmatically) 如何在 Swift 2.0 中没有 Storyboard 的情况下以编程方式从一个 ViewController 导航到另一个 - How to navigate from one ViewController to Other Programatically, without Storyboard in Swift 2.0 如何在没有情节提要的情况下设置ViewController的框架 - How to set the frame of a ViewController without storyboard 如何在情节提要中加载没有按钮的ViewController? - How to load viewcontroller without button in storyboard? 以编程方式将NavigationController添加到指定viewController中,而无需故事板快速 - Add navigationController to specif viewController programmatically without storyboard swift iOS Xcode 4.2使用StoryBoard呈现ViewController - iOS Xcode 4.2 using StoryBoard to present a ViewController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM