I have stumbled upon a problem that really shouldn't be too hard to figure out. However, after a lot of trial and error I have still not fount a solution. I have a CALayer created with CGRectMake(20, 20, 40, 40). I now want to scale this layer upwards by adding specific values to frame.size.height and frame.size.width, but when I do this, the layer scales downwards. I have tried modifying the anchorPoint, rotating the layer 180 degrees++, but no luck. Would love some input on this.
Thanks.
What I want vs What I get:
You just need to modify the y origin of your layer at the same time that you modify the height. I don't know exactly what your code looks like, but if you're taking the old frame and applying a constant change to the width and height, like this:
then you just need one more line, like:
before you reassign the layer's frame.