core-animation

Core Animation - Sheet-like Window Sliding

孤人 提交于 2020-01-01 18:12:42
问题 How difficult would it be to use core animation to make an NSView slide in an out of view like a sheet? Generally speaking, what would be involved in accomplishing this? I've been reading through the CA documentation, but it's been hard for me to pinpoint which parts are relevant to what I want to do since I have no experience with the framework. Any tips at all would be much appreciated. Thanks. 回答1: Since you're talking of a NSView, you're probably using Cocoa's animation support, not CA

CoreAnimation performance profiling - CAReplicatorLayer with CAShapeLayer

霸气de小男生 提交于 2020-01-01 14:23:22
问题 I'm making an app that relies on CoreAnimation. It has got a CAReplicatorLayer and as a sublayer a CAShapeLayer. When having 12 replications and then animating the path (changing it on touchMoved) there's a significant reduction in FPS once the graphics get bigger on screen (about 12-20 fps). The time profiler shows about 10 % CPU Utilization, the Open GL ES Driver profiler reports about 90-97% "Render Utilization" and 40-50 % "Tiler Utilization". This guide explains these two words but not

How can I get a CAAnimation to call a block every animation tick?

我的梦境 提交于 2020-01-01 11:45:30
问题 Can I somehow have a block execute on every "tick" of a CAAnimation? It could possibly work like the code below. If there's a way to do this with a selector, that works too. NSString* keyPath = @"position.x"; CGFloat endValue = 100; [CATransaction setDisableActions:YES]; [self.layer setValue:@(toVal) forKeyPath:keyPath]; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:keyPath]; animation.duration = 1; animation.delegate = self; __weak SelfClass* wself = self; animation

Infinitely looping animation

不羁岁月 提交于 2020-01-01 03:12:36
问题 I am trying to create an infinitely looping animation but am having some trouble. I am using this line of code the make my view "throb" red but when I call this line it works but make my UI unresponsive. [UIView animateWithDuration:1.0f delay:0.0f options:(UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat) animations:^{ self.backgroundColor = [UIColor colorWithRed:0.5 green:0.0 blue:0.0 alpha:1.0]; } completion:nil]; My questions are: 1)is this the correct way to do this? 2)why

Is there a way to prevent CALayer shadows from overlapping adjacent layers?

有些话、适合烂在心里 提交于 2020-01-01 03:04:08
问题 I have a collection of CALayers . Each layer is a sublayer of the same parent CALayer , and each has a shadow applied to it. The layers are positioned dynamically, and there are many of them, so I can't predict how they'll be arranged ahead of time. If the layers are adjacent to each other (close enough that they are almost touching) the shadow of one of the CALayers is rendered on top of the other CALayer . That's probably the desired effect in most cases, but I want my layers to exist in

UIView appereance from bottom to top and vice versa(Core Animation)

 ̄綄美尐妖づ 提交于 2019-12-31 22:25:54
问题 My goal is to understand and implement feature via Core Animation. I think it's not so hard,but unfortunately i don't know swift/Obj C and it's hard to understand native examples. Visual implementation So what exactly i want to do(few steps as shown on images): 1. 2. 3. 4. And the same steps to hide view(vice versa,from top to bottom) until this : Also,i want to make this UIView more generic,i mean to put this UIView on my StoryBoard and put so constraints on AutoLayout(to support different

UIView appereance from bottom to top and vice versa(Core Animation)

喜你入骨 提交于 2019-12-31 22:25:20
问题 My goal is to understand and implement feature via Core Animation. I think it's not so hard,but unfortunately i don't know swift/Obj C and it's hard to understand native examples. Visual implementation So what exactly i want to do(few steps as shown on images): 1. 2. 3. 4. And the same steps to hide view(vice versa,from top to bottom) until this : Also,i want to make this UIView more generic,i mean to put this UIView on my StoryBoard and put so constraints on AutoLayout(to support different

iPhone Flip Animation using UIViewAnimationTransitionFlipFromLeft in landscape mode

大城市里の小女人 提交于 2019-12-31 10:41:55
问题 I am working on one iPhone application in which I implemented one animation UIViewAnimationTransitionFlipFromLeft. Here my application works fine in the Portrait mode. It is doing the same animation as specified means Flip from Left to Right. But when I am doing this UIViewAnimationTransitionFlipFromLeft in landscape mode then it is not rotating from left to right. Instead of it is rotating from top to bottom. This is really critical issue. Can you help me out to solve this. The code I am

iPhone Flip Animation using UIViewAnimationTransitionFlipFromLeft in landscape mode

老子叫甜甜 提交于 2019-12-31 10:41:48
问题 I am working on one iPhone application in which I implemented one animation UIViewAnimationTransitionFlipFromLeft. Here my application works fine in the Portrait mode. It is doing the same animation as specified means Flip from Left to Right. But when I am doing this UIViewAnimationTransitionFlipFromLeft in landscape mode then it is not rotating from left to right. Instead of it is rotating from top to bottom. This is really critical issue. Can you help me out to solve this. The code I am

Using Core animation to animate StrokeColor

£可爱£侵袭症+ 提交于 2019-12-31 02:07:22
问题 I'm trying to animate CAShapeLayar's strokeColor property. I looked throught the documentation and it was stated that it is an animatable property. The code is working for animating postion.y but not the the strokeColor. I'll be happy to get any kind of help or advice The code I've used: lyr.fillColor = [[UIColor clearColor] CGColor]; lyr.lineWidth = 3.8; lyr.strokeColor = [[UIColor yellowColor] CGColor]; lyr.position = CGPointMake(160, 431); lyr.anchorPoint = CGPointMake(.5f, .5f); [self