1
當試圖在屏幕中間出現其他人時嘗試爲我的containerView設置動畫。但我不明白。如果只爲視圖添加動畫,那麼navBar不會做任何事情,如果我動畫它都會移動。如何使用CGAffineTransformMakeScale爲視圖及其導航欄製作動畫
When I only animate the view its look like this
When I animate the navigationBar its look like this
的,這是我的代碼
let datePickerController = self.storyboard!.instantiateViewControllerWithIdentifier("DatePickerViewController") as! DatePickerViewController
let navController = UINavigationController(rootViewController: datePickerController)
navController.modalPresentationStyle = UIModalPresentationStyle.Custom
navController.transitioningDelegate = self
UIView.animateWithDuration(0.3, delay: 0.0, options: UIViewAnimationOptions.CurveEaseInOut, animations: {
self.view.alpha = 0.5
self.navigationController!.navigationBar.alpha = 0.5
self.view.transform = CGAffineTransformMakeScale(0.9, 0.9)
//NavigationBar animattion
// self.navigationController!.navigationBar.transform = CGAffineTransformMakeScale(0.9, 0.9)
self.presentViewController(navController, animated:true, completion: nil)
}) { (Bool) in
}