core-animation

Scaled image in NSImageView looks bad with layer-backing on

醉酒当歌 提交于 2019-12-10 11:38:16
问题 I'd like to have a view with a gradient background and a image. So I turned on layer backing for the layer, added NSImageView and set the layer to CAGradientLayer . However, this makes the scaled-down image very ugly. See the comparison: Layer ON: , layer OFF: Has anyone observed this too? Is there any way to resolve this problem without turning off layer backing? 回答1: I stumbled across this question after running into exactly the same problem. The rendering for a layer-backed NSImageView

Learning using layers and CoreAnimation for iphone [closed]

与世无争的帅哥 提交于 2019-12-10 10:36:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Except for the official docs, what is a good resource for learning how to use CALayers and Core Animation efficiently/correctly? 回答1: Beyond Apple's documentation, I highly recommend Marcus Zarra and Matt Long's book "Core Animation: Simplified Animation Techniques for Mac and iPhone Development", as well as Bill

CATransformLayer - Performance issues when setting frame of sublayers

无人久伴 提交于 2019-12-10 10:35:54
问题 I have a CATransformLayer which has a couple of sublayers (CAShapeLayers). I'm setting the frames of my CAShapeLayers to have a size of (512, 512). Their content is (slightly) smaller than this. When rotating the whole scene in 3D it's slowing down the frame rate - but it renders everything correctly. If I do not set the frame property of the CAShapeLayers, then it's rotating the scene in 3D super fast but there are rendering mistakes. These are: Layers disappear at certain angles Wrong z

CALayer not displaying

女生的网名这么多〃 提交于 2019-12-10 10:26:26
问题 So this is my first ever attempt at using a CALayer. Build is successful and no reported bugs, so I assume I must be doing something obviously wrong. But the layer does not display at all. - (void)viewDidLoad { // Get Reliant Magenta in amazingly verbose manner CGColorSpaceRef rgbaColorSpace = CGColorSpaceCreateDeviceRGB(); CGFloat reliantMagentaValues[4] = {(208/255),(27/255),(124/255),0.3f}; CGColorRef reliantMagenta = CGColorCreate(rgbaColorSpace, reliantMagentaValues); CALayer

Pausing a SceneKit animation

丶灬走出姿态 提交于 2019-12-10 10:14:59
问题 I'm trying to create a test app in which the user can pause an animation by clicking in the SceneView. The SceneView loads the animation from a .dae file created in a 3d app (Cinema 4D). The app successfully plays and loops the animation upon launch. To pause the animation, I used Technical Q&A QA1673 as a reference. In the case of this .dae file, the animation actually comes in as a hierarchy of animations, so I have tried reaching down to each underlying CAKeyframeAnimation and setting its

Fading a UIView on top of a UITableView with Sections

我们两清 提交于 2019-12-10 10:13:08
问题 Greetings! I've added a UIActivityIndicatorView as a subview of a UITableView . The intent is to fade this view out once the underlying table has been refreshed with new data. The problem is that the sections in the table view (e.g., A, B, C, etc.) appear to be added after the Activity Indicator appears, partially blocking the activity indicator for a moment. Is there "a better way" (or more proper way) to be doing this sort of thing when it comes to activity indicators over table views with

Stop CABasicAnimation at specific point

岁酱吖の 提交于 2019-12-10 04:37:13
问题 I'm using a rotation animation created with CABasicAnimation . It rotates a UIView over 2 seconds. But I need to be able to stop it when the UIView is touched. If I remove the animation the view is in the same position as before the animation started. Here's my animation code: float duration = 2.0; float rotationAngle = rotationDirection * ang * speed * duration; //rotationAngle = 3*(2*M_PI);//(double)rotationAngle % (double)(2*M_PI) ; CABasicAnimation* rotationAnimation; rotationAnimation =

Why do docs indicate CALayer animations must be in UIView animation blocks?

早过忘川 提交于 2019-12-10 04:35:36
问题 I am currently reading Apple's Core Animation Guide, where I found the following passage regarding layer-backed views in iOS: If you want to use Core Animation classes to initiate animations, you must issue all of your Core Animation calls from inside a view-based animation block. The UIView class disables layer animations by default but reenables them inside animation blocks. So any changes you make outside of an animation block are not animated. Just below the quote, the documentation

CATransform3DRotate and UIImageView

烈酒焚心 提交于 2019-12-10 03:59:47
问题 I'm animating an UIImage view with this code CABasicAnimation *animation; animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; animation.duration = 1; animation.toValue = [NSNumber numberWithFloat:M_PI]; animation.fromValue = [NSNumber numberWithInt:0]; [square.layer addAnimation:animation forKey:@"rotation"]; All works fine but my array take his original position at the end of animation. I looked into the layer properties and found : [square.layer setTransform

Using transition CIFilters for CATransition

China☆狼群 提交于 2019-12-10 03:39:50
问题 I'm trying to use CATransition 's filter property with the new iOS 6 transition animations (CIBarsSwipeTransition, CICopyMachineTransition, etc.). The CIFilter documentation says that these are available on iOS 6, and nothing on the CATransition documentation says that the filter property cannot be used. But, I can't seem to get them to work. I don't know if Apple just failed to mention the inavailability of the functionality or I'm just missing something to make it work. Here's how I set it