Sobes.tech
Junior — Middle

How do the properties of Frame and Bounds change when rotating the screen by 45 degrees?

sobes.tech AI

Answer from AI

When the screen is rotated by 45 degrees, the properties of Frame and Bounds of UIView change as follows:

  • Frame — is a rectangle describing the position and size in the superview's coordinates. When rotating the view around its axis, the Frame changes because its axes are shifted and rotated along with the view. The size of the Frame may change if the view is not square, due to the rotation of the rectangle.

  • Bounds — is a rectangle describing the internal coordinates of the view, usually starting at (0,0) and defining the size of the view. When rotating the view, the Bounds remain unchanged because it describes the internal space of the view, which does not depend on orientation.

In summary, when rotated by 45 degrees, the Frame will change (its coordinates and possibly its size), while the Bounds will remain the same.

How do the properties of Frame and Bounds change when… - sobes.tech