【发布时间】:2019-05-26 08:57:11
【问题描述】:
底部布局指南在 ios 11 中显示已弃用?在开发应用程序时。虽然我尝试使用布局锚但不起作用,但我附上了我的代码问题的图片
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
coordinator.animate(alongsideTransition: { (transitionCoordinatorContext) -> Void in
let orient = UIApplication.shared.statusBarOrientation
for (index, var layoutAnchor) in self.arrBottomAnchor.enumerated() {
layoutAnchor.isActive = false
switch orient {
case .portrait:
layoutAnchor = self.arrViews[index].bottomAnchor.constraint(equalTo: self.bottomLayoutGuide.topAnchor)
case .landscapeLeft,.landscapeRight :
layoutAnchor = self.arrViews[index].bottomAnchor.constraint(equalTo: self.bottomLayoutGuide.bottomAnchor)
【问题讨论】:
标签: swift