- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 iMessage 应用程序(iOS 10)中放置一个带有表格 View Controller 的导航 Controller 。当我把 UINavigationController
在 UIContainerView
内在 MSMessagesViewController
内.
但是,这在展开 View 时会中断。 UINavigationBar
Controller 消失了。
我该如何解决这个问题,还是我采取了错误的方法?
最佳答案
让我先假设您使用了 view.addSubview
添加您的UITableViewController
到MSMessagesAppViewController
为了正确显示导航栏。确保您已正确设置所有约束。这是我的示例,希望这对您有用:
//嵌入新的 Controller 。 WWDC 中展示的 VC 推荐方式(冰淇淋示例)。丑陋但有效
addChildViewController( Controller )
view.addSubview(controller.view)
让 viewRect = view.bounds
Controller .view.frame = viewRect
controller.view.translatesAutoresizingMaskIntoConstraints = false
controller.view.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
controller.view.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
controller.view.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor).isActive = true
如果presentationStyle == .compact {
controller.view.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
} 别的 {
controller.view.bottomAnchor.constraint(equalTo: bottomLayoutGuide.topAnchor).isActive = true
}
controller.didMove(toParentViewController: self)
这是 Apple Developer Forum 上解决我的问题的帖子的链接:https://forums.developer.apple.com/thread/52049
关于ios - 如何防止导航栏随着 MSMessagesViewController -> UIContainerView -> UINavigationController -> UITableViewController 消失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38426146/
我正在尝试将初始 View Controller 中的 activeConversation 传递给另一个 View Controller 。我这样做的方法是将一个名为 currentConversa
我正在尝试在 iMessage 应用程序(iOS 10)中放置一个带有表格 View Controller 的导航 Controller 。当我把 UINavigationController在 UI
我是一名优秀的程序员,十分优秀!