Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView's bounds size vs frame size

Can a frame's size be different from the bound's size of a UIView.

Whenever I set either of them, I notice that both change and they are always in sync. Is there an edge case where this is not true?

like image 581
shreyasva Avatar asked Oct 16 '25 15:10

shreyasva


1 Answers

Yes; for example, a transformed (e.g. rotated) view has a different (and useless) frame size.

The frame is purely a convenience, and you could live entirely without it if you had to; the bounds size and center, together, accurately and always describe the view's position and size.

like image 118
matt Avatar answered Oct 19 '25 07:10

matt