Hi. I'm trying to implement a flip animation to be used in board game like iPhone-application. The animation is supposed to look like a game piece that rotates and changes to the color of its back (kind of like an Reversi piece). I've managed to create an animation that flips the piece around its orthogonal axis, but when I try to flip i...
I have a CALayer subclass, MyLayer, that has a NSInteger property called myInt. I'd really like to animate this property via CABasicAnimation, but it seems CABasicAnimation only works on so-called "animatable" properties (bounds, position, etc). Is there something I can override to make my custom myInt property animatable?
...
I've got a UIView (and thus a CALayer) which I'm trying to warp or bend slightly in 3D space. That is, imagine my UIView is a flat label which I want to partially wrap around a beer bottle (not 360 degrees around, just on one "side").
I figured this would be possible by applying a transform to the view's layer, but as far as I can tell,...
Hi, I'm trying to make use of CALayers to create a 3D style effect in one of my applications. However, it seems that nested CALayers do not have perspective applied to them.
To illustrate with pseudo-code, if I have a layer with perspective applied like so:
CATransform3D subLayerTransform = CATransform3DIdentity;
/* set perspective */...
I have two CALayer objects. layerA and layerB. I want to copy the bitmap from layerA over to layerB, so that layerB has the "same" bitmap (that looks the same).
How could I do that without using UIImage and the like inbetween?
...
I'm trying to animate a GIF and I hit a roadblock. I have an example of what I'm trying to do that uses the individual frames of the GIF and setting the animationImages property of a UIView. However in my project, the thing I want to animate is drawn using Layers. I'm looking for a quick and easy way to animate the frames without introdu...
I have a UIView which has about 8 different CALayer sublayers added to its layer.
If I modify the view's bounds (animated), then the view itself gets shrinked (I checked it with a backgroundColor), but the sublayers' size remains unchanged.
How to solve this?
I've just started googleing but haven't found any useful. Thanks in advance.
...
I'm trying to learn how to use CALayers for a project and am having trouble getting sublayers to display. I created a vanilla View-based iPhone app in XCode for these tests. The only real code is in the ViewController which sets up the layers and their delegates. There is a delegate, DelegateMainView, for the viewController's view lay...
I would like to tile a CGImage across a CALayer, but it seems to only want to stretch it.
The example code:
self.background = [UIImage imageNamed: @"Background.png"];
[documentDisplay.layer setContents: self.background.CGImage];
I would like to avoid subclassing if I could.
...
On each cell of my table view I want to have a bar that the user can slide out from the right. On the bar I plan to have icons. So, to do this I subclassed UITableViewCell. On the cell I have implemented drawRect and in there I have already drawn a gradient and background color on the cell. From there, I can create a CALayer, give it...
I have a CALayer subclass. I have overridden the drawInContext method. I want the majority of my layer to be transparent except a few areas. I'm using the layer as a menu and I want the icons and labels on the menu to be opaque.
Is it possible to have a CALayer's sublayers be opaque if the super CALayer is transparent?
Is it possi...
Basically, I want to animate a shrinking circle. I've already done this by drawing progressively smaller circles onto CGLayer's, and then using
if(index < 30){
[self performSelector:@selector(showNextLayer) withObject:nil afterDelay:(NSTimeInterval)0.02];
index++;
}
in my showNextLayer method. This works for my simple goal, but in ge...
Hello,
I have added a CALayer to the UIView of my app:
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
...
Hello, Im trying to add a animation to a UIImageView, but it always fails. Why? Here is the code:
//(…)
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
animationImage = [[UIImageView alloc]initWithImage:newImage];
[self.view addSubview:animationImage];
CATransition *animation...
I'm using CALayers to draw to a UITableViewCell. I'm trying to figure out how layers are ordered with the content of the UITableViewCell. For instance:
I add labels to the UITableViewCell in my cellForRow:atIndexPath method
In the drawRect method of UITableViewCell I draw some content using the current context
Also, in drawRect I add...
I have a ViewController with a view (UIView). I need to handle touches, run some logic, check against model data, and and add and remove sublayers to the view based on those touches. Then I need to update the model based on the results.
Should I have:
ViewController - manage touches, get/set model data, add/remove sublayers
UIView
...
Hello All,
I have a CALayer with a png image as its content.When rotation is applied the layer looks blurry.
I've searched for a cause for this problem and found out that the problem might be the half pixel problem, which makes the layer blurry if its frame.origin lays on fractions like 96.5, and they suggest to make the origin a whol...
Would the code bellow cause my code to leak? More specifically, am I responsible for releasing the newImage or the contents of mainPageLayer (which is a CALayer object)? I get a memory warning every 4th time that method is called, but cant figure out why...
I also can't figure out why mainPageLayer.contents = [newImage CGImage]; throws ...
hello, i am trying to implement a graph which a uiview draws. There are 3 UIViews to animate a left/right slide. The problem is, that i can't cancel the UIView animation. So I replaced the UIViews by CALayer. Now, the question is if CALayer is appicable for this? Is it normal to draw on a CALayer like this? And why is a CALayer so slow w...
Hello all,
I'm currently facing some performance issues, when using several custom layers as sublayers inside my view.
After creating my new layer programmatically, I add it as sublayer, like:
[self.view.layer addSublayer:myNewSublayer];
This works just fine. However, when doing this over and over my app starts to slow down more an...