frame和bounds区别

frame和bounds区别_第1张图片

Which  to use?

-Usually depends on the context

 

If you are using a view, typically you use frame

If you are implementing a view,typically you use bounds

Matter of perspective

-From outside it's usually the frame

-From inside it's usually the bounds

 

Examples:

-Creating a view,positioning a view in superview - use frame

-Handing events,drawing a view - use bounds

你可能感兴趣的:(frame)