Ios 如何使用CGAffineTransformMakeScale设置视图及其导航栏的动画 我试图在屏幕中间呈现另一个容器时激活我的容器视图。但我不明白。如果仅对视图设置动画,导航栏将不会执行任何操作,如果我同时对这两个视图设置动画,导航栏将移动
这是我的密码Ios 如何使用CGAffineTransformMakeScale设置视图及其导航栏的动画 我试图在屏幕中间呈现另一个容器时激活我的容器视图。但我不明白。如果仅对视图设置动画,导航栏将不会执行任何操作,如果我同时对这两个视图设置动画,导航栏将移动,ios,swift,uiview,core-animation,Ios,Swift,Uiview,Core Animation,这是我的密码 let datePickerController = self.storyboard!.instantiateViewControllerWithIdentifier("DatePickerViewController") as! DatePickerViewController let navController = UINavigationController(rootViewController: datePickerController) navContr
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
}
我解决了,解决办法就是改变这条线
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.navigationController!.view.transform = CGAffineTransformMakeScale(0.93, 0.93)
self.navigationController!.view.alpha = 0.5