catransition

Core Animation学习笔记

我的未来我决定 提交于 2020-12-18 00:53:51
Core Animation的基类为CAAnimation,使用起来还是比较简单方便的,可是实现绚丽的动画效果,步骤可分为如下三步 a. 创建一个CAAnimation的子类对象 b. 为该对象添加一些属性 c. 为需要执行该动画视图的layer添加该动画 看一个简单的例程 var aview = UIView(frame: CGRectMake(20, 20, 80, 80)) aview.backgroundColor = UIColor.blackColor() self.view.addSubview(aview) var basicAnimation = CABasicAnimation(keyPath: "transform.scale") basicAnimation.fromValue = 0.5 basicAnimation.toValue = 1.0 basicAnimation.duration = 2.0 basicAnimation.repeatCount = 3 aview.layer.addAnimation(basicAnimation, forKey: "scale") 首先创建了一个CAAnimation的子类CABasicAnimation,由于 CAAnimation为抽象类,需要使用时,需要使用其子类。CAAnimation的类层次图为

Push Up View Controller from Bottom using Swift

自古美人都是妖i 提交于 2020-02-26 05:33:25
问题 I would like to push a view controller using Swift and animate it so it appears from the bottom and moves up. I have the following code to push my view controller: let helloTableViewController = self.storyboard!.instantiateViewControllerWithIdentifier("helloTableViewController") as! HelloTableViewController self.navigationController!.pushViewController(helloTableViewController, animated: true) I have found the following from another question but cannot seem to get it to work in Swift:

Push Up View Controller from Bottom using Swift

风流意气都作罢 提交于 2020-02-26 05:32:54
问题 I would like to push a view controller using Swift and animate it so it appears from the bottom and moves up. I have the following code to push my view controller: let helloTableViewController = self.storyboard!.instantiateViewControllerWithIdentifier("helloTableViewController") as! HelloTableViewController self.navigationController!.pushViewController(helloTableViewController, animated: true) I have found the following from another question but cannot seem to get it to work in Swift:

Push Up View Controller from Bottom using Swift

筅森魡賤 提交于 2020-02-26 05:32:04
问题 I would like to push a view controller using Swift and animate it so it appears from the bottom and moves up. I have the following code to push my view controller: let helloTableViewController = self.storyboard!.instantiateViewControllerWithIdentifier("helloTableViewController") as! HelloTableViewController self.navigationController!.pushViewController(helloTableViewController, animated: true) I have found the following from another question but cannot seem to get it to work in Swift:

CATransition page curl from top

若如初见. 提交于 2020-01-13 07:27:10
问题 I wanted to know if anyone managed a pagecurl from the top using the CATRANSITION. I have the following : CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:0.35]; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; animation.type = @"pageCurl"; animation.subtype = kCATransitionFromTop; animation.fillMode = kCAFillModeForwards; animation.endProgress = 0.30; [animation setRemovedOnCompletion:NO]; [self.view.layer addAnimation

Change CALayer color while animating

血红的双手。 提交于 2020-01-01 07:11:06
问题 APPROACH 1 CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; [CATransaction begin]; { [CATransaction setAnimationDuration:15];//Dynamic Duration [CATransaction setCompletionBlock:^{ }]; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; animation.autoreverses = NO; animation.removedOnCompletion = NO; animation.fromValue = @0; animation.toValue = @1; animation.timeOffset = 0; animation.fillMode =

dismissModalViewController with transition: left to right

给你一囗甜甜゛ 提交于 2019-12-28 10:44:52
问题 I was using a nice method to dismiss my modal view controller: [self dismissModalViewControllerWithTransition:2]; which makes a slide transition from left to right, like a navigation controller does to pop a view. As this method is a non-public method, apple will not accept it. How can I program this kind of animation in my code (slide from left to right, to dismiss a modal view, and slide from right to left to present a modal view) ? Thanks in advance 回答1: I have accepted the answer from

View being blocked by UITransitionView after being presented

我的梦境 提交于 2019-12-18 12:18:45
问题 I have a side navigation controller and present it via a UIButton. When I make this NC the root view controller directly by [self presentviewcontroller: NC animated: YES completion: nil] , some reason the menu side of the NC is blocked by a UITransitionView that I cannot get to disappear. I've attached an image of the . is another. I have tried the following: UIWindow *window = [(AppDelegate *)[[UIApplication sharedApplication] delegate] window]; window.backgroundColor = kmain; CATransition*

CATransition to other view works, crashes on transition back

五迷三道 提交于 2019-12-12 17:40:25
问题 I am using this code to transition from the current view to another and it works. The problem is that when I try to return to the current view the app crashes. This is the code I use to pass from the current view to the new one: CATransition *transition = [CATransition animation]; transition.duration = 0.75; // using the ease in/out timing function transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionReveal;

iphone page curl without uiviewanimation

跟風遠走 提交于 2019-12-11 16:44:46
问题 I am trying to do a partial page curl with the following: CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.0f]; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; [animation setType:(notCurled ? @"mapCurl" : @"mapUnCurl")]; [animation setRemovedOnCompletion:NO]; [animation setFillMode: @"extended"]; [animation setRemovedOnCompletion: NO]; notCurled = !notCurled; [[delegate.window layer] addAnimation:animation forKey:@