Questions tagged [calayer]

CALayer is a Core Animation class in the Quartz Core framework. It encapsulates the geometry and presentation of a layer. It supports animations of the layer's geometry and its content.

The layer classes are the foundation of Core Animation and provide an abstraction that should be familiar to developers who have used NSView or UIView. Basic layer functionality is provided by the CALayer class, which is the parent class for all types of Core Animation layers.

The CALayer class is the model class for layer-tree objects. It encapsulates the position, size, and transform of a layer, which defines its coordinate system. It also encapsulates the duration and pacing of a layer and its animations by adopting the CAMediaTiming protocol, which defines a layer’s time space.

2853 questions
1
vote
3 answers

Add a sublayer to a CALayer without animation?

How can I add a sublayer to a CALayer without animation? Usually when you add one it "fades in" and when you remove one it "fades out". How to supress the animation?
Kristina
  • 15,859
  • 29
  • 111
  • 181
1
vote
1 answer

Custom Controls for iOS are always offset

I'm making a few custom controls for iOS. Each of these controls draws various layers in drawRect and every single one of the layers seems to be offset for some reason. They're suppose to be centered in the view. Here's an example of a pie chart…
Jake
  • 13,097
  • 9
  • 44
  • 73
1
vote
0 answers

Detect UITapGestureRecognizer on UIView with transform

I’ve attached a UITapGestureRecognizer to my UIView which works as expected, however, as part of my user interface the view gets rotated when tapped the first time. Now, the same tap gesture is no longer fired when I try to tap on the view. The…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
1
vote
1 answer

How to render a layer hosting NSView to file

Is there any way to render a layer hosting NSView (as it appears onscreen) to a PDF or bitmap file without implementing each CALayer's –drawInContext: method (or similarly, each layer's delegate's -(void)drawLayer:inContext: method)? I just want the…
chris.bennett
  • 69
  • 1
  • 6
1
vote
1 answer

Subclassed CALayer animation function does not animate

Currently, I have subclassed CALayer to create a animatable bottom border for my UITextField. However, my animateColor function is not working. I've tested to see if the function is being called and it is. However, no animation is taking place. What…
iamktothed
  • 1,398
  • 2
  • 14
  • 22
1
vote
1 answer

How to use block based animation for a CALayer?

I attempted to infinitely pulse a gradient from transparent to opaque using UIView's block animation. The final result is the gradient remains at full opacity with no animation. Is it even possible to animate CALayer's with the block style or must I…
JoJo
  • 19,587
  • 34
  • 106
  • 162
1
vote
1 answer

Right way to fit image to CALayer contents in swift programmatically?

I am new to programming. @IBOutlet weak var myView: UIView! var l: CALayer { return myView.layer } override func viewDidLoad() { super.viewDidLoad() setUpLayer() } func setUpLayer() { l.contents = UIImage(named:…
Kyle KIM
  • 1,384
  • 2
  • 15
  • 31
1
vote
2 answers

Using CABasicAnimation animationWithKeyPath:@"contents" on CATextLayer to display dynamic overlay text on Video

I'm am working on an App that adds dynamic text (like subtitles) to a video. There are a number of similar questions, but none really have a working answer. I had high hopes for using "ContentAnimate" instead of "contents" as the animationKeyPath…
JacobU
  • 11
  • 4
1
vote
1 answer

CALayer contents not being displayed in Swift2

import UIKit class ViewController: UIViewController { @IBOutlet weak var myView: UIView! override func viewDidLoad() { super.viewDidLoad() let url = NSURL(string:…
Sri Ram
  • 35
  • 8
1
vote
2 answers

I don't know why my view is freezing

I have a big problem since a few days that I can't solve. First I have a login view controller with this code : @implementation MMConnectionViewController @synthesize login, password, activityIndicator, mainVC; -…
Romain Piel
  • 11,017
  • 15
  • 71
  • 106
1
vote
1 answer

How to add mask on UIImageView in Cell - Swift

I've a tableView and I'm trying to add black mask on each image in the cell not on the whole cell just on the image. But I have two issues; -It is masking the half cell from the left to the middle and each I scroll it is becoming darker. So please…
Luai Kalkatawi
  • 1,492
  • 5
  • 25
  • 51
1
vote
2 answers

How to rotate a CAShapeLayer arc around a circle?

I have the two CAShapeLayers forming the following display: They are created with this piece of code: CALayer *layer = [loadingView layer]; CAShapeLayer *circle = [CAShapeLayer layer]; [circle setPath:[[UIBezierPath…
Matoe
  • 2,742
  • 6
  • 33
  • 52
1
vote
2 answers

How to get x, y, width, height of UIView which is using auto layout

I am trying to set mask on my blue UIView for which I have to set frame for mask but problem is blue UIView is using auto layout. How can I get x, y, width, height of UIView which is using auto layout to use like this [self.v.layer.mask…
S.J
  • 3,063
  • 3
  • 33
  • 66
1
vote
0 answers

How to move CALayer with UIScrollView together?

I created a UIScrollView, and also a CALayer on top of it. My question is when I scroll the view, how CALayer can also moves? For example the CALayer is always at the relative position of the UIScrollView when the UIScrollView moves or zoom get…
Andy Dong
  • 405
  • 5
  • 10
1
vote
1 answer

Can't get layer mask to work properly

I have a UIImageView called zigZag. All I want to do is set a layer mask on it so that it is not visible at all. I then want to animate the layer mask later so that the UIImageView becomes visible again. I have been working on this for 4 hours now…
user3344977
  • 3,584
  • 4
  • 32
  • 88
1 2 3
99
100