Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the relationship between a UIView.frame and CALayer.frame? (both pre and post a CATransform3D)

How is a CALAyer.frame related to its UIView.frame? (in this case specifically a UIImageView.frame).

Given that the values for a CALayer.frame potentially differ from its UIView.frame following a CAtransform3D transformation, do they no longer have any connection? (and subsequently, should I be more concerned about managing the dimensions of my CALayer rather than my UIImageView in my superview?).

like image 865
NSTJ Avatar asked Jul 03 '12 15:07

NSTJ


1 Answers

If you are working with Core Animation and layers, you should focus on the following CALayer properties:

  1. position
  2. bounds
  3. anchorPoint
  4. transform

A quote from Apple Technical Q&A QA1620 available here:

Q: When I try to animate the frame of a CALayer nothing happens. Why?

A: The frame property of a CALayer is a derived property, dependent on the position, anchorPoint, bounds and transform of the layer. Instead of animating the frame, you should instead animate the position or bounds, depending on what effect you are trying to accomplish.

like image 87
svena Avatar answered Jan 02 '23 19:01

svena