所以我有一个容器View(停靠在屏幕边缘)和一个应该可以滑入和滑出的子View。p>funcslideOut(){UIView.animateWithDuration(Double(0.5),animations:{self.container.bottomAnchor.constraintEqualToAnchor(self.child.bottomAnchor).active=falseself.view.layoutIfNeeded()})}funcslideIn(){UIView.animateWithDuration(Double(0.5),animations:{self.