core-animation

Combining autolayout with core animation

不羁岁月 提交于 2019-12-07 02:15:28
问题 I'm new to core animation and I'm struggling with one thing - how to combine autolayout with core animation. Actually I've found only one sentence in the documentation of Core Animation which refers to Autolayout here is it Remember to Update View Constraints as Part of Your Animation If you are using constraint-based layout rules to manage the position of your views, you must remove any constraints that might interfere with an animation as part of configuring that animation. Constraints

Core Animation difficulties with spinning dial control (very detailed)

一笑奈何 提交于 2019-12-07 01:58:31
问题 Im trying to create a spinning dial control, basically a set of 6 digits that spin around and around to give the effect of a spinning number meter (similar to your power/water meters, or perhaps a poker machine, in fact very similar to the existing UIPickerView control, but with a completly different look and feel). So far, I almost have it working, but Im at a stage where core animation is giving me grief. Its quite complex, so code snippets would be tough to give a good snapshot of what is

Avoiding blended layers when using resizableImages on iOS

☆樱花仙子☆ 提交于 2019-12-07 01:54:25
问题 I'm trying to avoid blended layers on iOS to improve performance. However, I notice that the resizable image I'm using for the backgroundView of my UITableViewCell is being marked as a blended layer: In fact, using any resizable image--even a JPEG with no transparency--caused layer blending, as seen in this screenshot where first a PNG and then a JPEG is used as a resizable image in a UIImageView . The only resizable image that didn't require a blended layer was a 1x1 pixel image, seen at the

Is there a way to change the animation style of a modal view controller appearance?

ε祈祈猫儿з 提交于 2019-12-07 01:44:18
问题 I am trying to animate the appearance and disappearance of two view controllers' view. I used the following two lines of code: self.modalTransitionStyle=UIModalTransitionStyleCoverVertical; [self presentModalViewController:viewcontroller animated:YES]; to make the view controller's view animate in from the bottom of the screen, which works well. My question is: can I change the style of this animation so that the view isn't always sliding in from the bottom of the screen? How can I make it

CABasicAnimation creates empty default value copy of CALayer

穿精又带淫゛_ 提交于 2019-12-07 00:06:28
I have a custom CALayer that draws radial gradients. It works great except during animation. It seems that each iteration of CABasicAnimation creates a new copy of the CALayer subclass with empty, default values for the properties: In the screenshot above, you see that CABasicAnimation has created a new copy of the layer and is updating gradientOrigin but none of the other properties have come along for the ride. This has the result of not rendering anything during the animation. Here's a GIF: Here's what is should look like: Here's the animation code: let animation = CABasicAnimation(keyPath:

Adding Tap Gesture on UIImage

萝らか妹 提交于 2019-12-06 18:45:59
问题 I am trying to make clickable UIImage, where the user can click it then it'll animate... i am working with the UIScrollVIew that's why i used the UITapGesture instead of touchesBegan, and it seems that UIGestureRecognizer is not compatible with UIImage... am i right? i keep receiving this error message receiver type 'UIImage' for instance message does not declare a method with selector 'addGestureRecognizer' is there any other way? 回答1: You have to add TapGesture in UIImageView not UIImage

What is an “misaligned image” in terms of Core Animation in iPhone OS?

时光毁灭记忆、已成空白 提交于 2019-12-06 17:52:59
问题 Instruments tells that there are "misaligned images" which are animated by core animation. What does that mean? UPDATE: I've seen that in Instruments.app > Core Animation. 回答1: I'd love more information about where you're seeing this, but my suspicion is that it's referring to an image that is not pixel-aligned. Quartz allows you to draw at fractional pixels (recall that CGPoint takes CGFloats, not NSIntegers), but it's more expensive and tends to create a bit of blurriness. You can't really

UIView infinite loop Animation to call a method after every repeat cycle

强颜欢笑 提交于 2019-12-06 15:34:55
I am at my wits end trying to come up with a design pattern for this paradigm. I haven't had much luck on this site but at this stage I'll try anything. I am trying to implement a radar type animation and hence I am rotating a view 360 degrees to represent the radius rotating around the circle. I have placed points around this circle and am able to calculate the angle from the center of the circle using standard trig. As the radius sweeps around the circle, if it intersects with a point (eg angle of the point equals the angle of the sweeping radius + a tolerance) the point flashes on. Now, I

How to make a filling progress circle in iOS?

筅森魡賤 提交于 2019-12-06 15:03:14
I need to make a progress circle like this: I have created a CAShapeLayer for the circle, and animate its strokeEnd property like this: pieShape = CAShapeLayer() pieShape.path = UIBezierPath(arcCenter: CGPointMake(29, 29), radius: 27.0, startAngle: CGFloat(startAngle), endAngle: CGFloat(endAngle), clockwise: true).CGPath pieShape.fillColor = UIColor.clearColor().CGColor pieShape.strokeColor = UIColor.blackColor().CGColor pieShape.lineWidth = 4.0 self.layer.addSublayer(pieShape) let countDownAnimation = CABasicAnimation(keyPath: "strokeEnd") countDownAnimation.duration = durationInSeconds

Does Core Animation provide public APIs for iBook style page curl page transitions?

五迷三道 提交于 2019-12-06 14:30:17
Does Core Animation provide public APIs for iBook style page curl page transitions? I have seen this blog post which is an almost exact re-engineering of iBook page-curl transitions but it relies on private APIs. Is there in fact a public version and if not is there something in open source? palaniraja Check the answer for Flipboard or iBooks style animation the code is available @ GitHub. If you want to roll your own solution with OpenGL ES, I've written an introduction to simulating a page curl using a conical deformation algorithm . While it's probably not the same solution Apple uses, it