123*_*321 8 uistoryboardsegue autolayout imessage ios10 ios-messages-extension
在消息扩展应用程序中使用Segues时,布局变得混乱.
有没有办法解决这个问题,同时仍然使用storrybord segues?
截图:(
注意:第一个和第二个View/ViewController是相同的.segue类型无关紧要)
扩展的演示风格:
紧凑的演示风格:
更新1:
在segue之后,顶部和底部布局指南会重置
PS有人可以创建一个新的"消息扩展"标签吗?
我希望这并不总是必要的,但我最终使用了约束出口、presentationStyle 变量和 viewDidLayoutSubviews() 的组合来克服这个错误/疏忽。
在我的 DetailViewController 中:
@IBOutlet weak var myViewTopConstraint: NSLayoutConstraint!
var presentationStyle: MSMessagesAppPresentationStyle?
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if presentationStyle == .expanded {
myViewTopConstraint.constant = 86
} else {
myViewTopConstraint.constant = 0
}
}
Run Code Online (Sandbox Code Playgroud)
在我的 MainViewController 中:
override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) {
if let detailController = presentedViewController as? DetailViewController {
detailController.presentationStyle = presentationStyle
}
}
Run Code Online (Sandbox Code Playgroud)
如果它有所不同,我的 segue 将模态地呈现为页面表。
| 归档时间: |
|
| 查看次数: |
1519 次 |
| 最近记录: |