【发布时间】:2017-11-02 03:40:05
【问题描述】:
如何在另一个 UIViewController 中添加 mathwidget 作为子视图 目前,加载 UIViewController 时,mathwidget 工作正常。 让 subViewEE = MathWidgetClassName() self.present(subViewEE, 动画: true, 完成: nil)
但是当我尝试将它添加为当前视图控制器中的子视图时,没有任何显示,这里是代码:
let mathWidget= MathWidgetClassName()
self.addChildViewController(mathWidget)
self.view.addSubview(mathWidget.view)
mathWidget.didMove(toParentViewController: self)
谁能帮助将 MathWidget 显示为当前 UIViewController 中的子视图?
【问题讨论】:
-
MathWidgetClassName是UIVIewController的子类?
标签: ios swift uiview uiviewcontroller subview