Swift 嵌入导航栏/选项卡栏会打破正常功能视图的约束

Swift 嵌入导航栏/选项卡栏会打破正常功能视图的约束,swift,ios8,autolayout,constraints,xcode6.1,Swift,Ios8,Autolayout,Constraints,Xcode6.1,我有一个简单的问题 正常工作的UIViewController: 查看背景颜色 UITextView UIView作为底部和文本视图之间的间隔 将textview固定到视图的约束,该视图又固定到bottomlayoutguide 点击文本视图加载键盘,间隔视图相应展开,以避免键盘与我的文本视图重叠 但是,在向具有正常工作约束的视图添加选项卡栏或导航栏后 三件事破裂了: 背景不再渲染,产生黑色背景 textview未注册点击,即键盘未加载 视图忽略底部布局指南。它只是将我的对象向上移动到它们的最高

我有一个简单的问题

正常工作的UIViewController: 查看背景颜色 UITextView UIView作为底部和文本视图之间的间隔 将textview固定到视图的约束,该视图又固定到bottomlayoutguide 点击文本视图加载键盘,间隔视图相应展开,以避免键盘与我的文本视图重叠 但是,在向具有正常工作约束的视图添加选项卡栏或导航栏后

三件事破裂了: 背景不再渲染,产生黑色背景 textview未注册点击,即键盘未加载 视图忽略底部布局指南。它只是将我的对象向上移动到它们的最高点。顶部约束允许它们。不过,textview和uiview之间的约束仍然有效。
注释掉view.setTranslatesAutoResizengMaskintoConstraintsFalse已清除所有错误

...
//var memoArea = UITextView(frame: CGRectMake(20, 291, 275, 225))
memoArea.addConstraint(NSLayoutConstraint(item: memoArea, attribute: .Width, relatedBy: .Equal,
   toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 275.0))

memoArea.addConstraint(NSLayoutConstraint(item: memoArea, attribute: .Height, relatedBy: .Equal,
    toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 225.0))

self.view.addConstraint(NSLayoutConstraint(item: memoArea, attribute: .Leading, relatedBy: .Equal,
    toItem: self.view, attribute: .Leading, multiplier: 1.0, constant: 20.0))

// var spacer:UIView = UIView(frame: CGRectMake(84, 518, 160, 6))
spacer.addConstraint(NSLayoutConstraint(item: spacer, attribute: .Width, relatedBy: .Equal,
   toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 160.0))

spacer.addConstraint(NSLayoutConstraint(item: spacer, attribute: .Height, relatedBy: .Equal,
    toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 6.0))

self.view.addConstraint(NSLayoutConstraint(item: spacer, attribute: .Leading, relatedBy: .Equal,
    toItem: self.view, attribute: .Leading, multiplier: 1.0, constant: 84.0))

view.setTranslatesAutoresizingMaskIntoConstraints(false)
spacer.setTranslatesAutoresizingMaskIntoConstraints(false)
memoArea.setTranslatesAutoresizingMaskIntoConstraints(false)
...
...
func updateBottomLayoutConstraintWithNotification(notification: NSNotification) {
let userInfo = notification.userInfo!
let animationDuration = (userInfo[UIKeyboardAnimationDurationUserInfoKey] as NSNumber).doubleValue
let keyboardEndFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue()
let convertedKeyboardEndFrame = view.convertRect(keyboardEndFrame, fromView: view.window)
let rawAnimationCurve = (notification.userInfo![UIKeyboardAnimationCurveUserInfoKey] as NSNumber).unsignedIntValue << 16
let animationCurve = UIViewAnimationOptions.init(UInt(rawAnimationCurve))

let frame = self.tabBarController?.tabBar.frame
let height = frame?.size.height
spacerToBottom.constant = CGRectGetMaxY(view.bounds) - CGRectGetMinY(convertedKeyboardEndFrame) - height! - 5

UIView.animateWithDuration(animationDuration, delay: 0.0, options: .BeginFromCurrentState | animationCurve, animations: {
self.view.layoutIfNeeded()
}, completion: nil)
...