【发布时间】:2017-01-03 07:01:24
【问题描述】:
我在使用 Xcode 8 beta 6 中的情节提要设计自定义键盘时遇到了一些问题。
出于某种原因,当我在 iOS 10 设备上启动键盘时,结果如下:
这就是我在故事板中的设计方式,顶视图:
底视图:
所以它只显示底部视图的高度。
我在 iOS 9 上没有这个问题。
关于出了什么问题的任何想法?
更新 2:
即使在 viewDidLoad() 中以这种方式以编程方式创建视图也不起作用:
self.view.backgroundColor = UIColor.orange
let bottomView = UIView()
bottomView.backgroundColor = UIColor.blue
self.view.addSubview(bottomView)
bottomView.translatesAutoresizingMaskIntoConstraints = false
let trailing = bottomView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor)
let leading = bottomView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor)
let bottom = bottomView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -50)
let top = bottomView.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 0)
NSLayoutConstraint.activate([trailing, leading, bottom, top])
我写信给苹果错误报告。
希望能得到他们的消息
【问题讨论】:
-
人们对这个问题投了反对票。能否请他们在 cmets 中写下他们这样做的原因?
标签: storyboard swift3 custom-keyboard ios10 xcode8-beta6