Why iOS coordinate system is difficult to understand?? only me?

后端 未结 1 350
Happy的楠姐
Happy的楠姐 2021-01-16 21:57

I\'m studying iOS\' UIView! And I found that I can\'t understand how bounds works.

For example,

Please run this code ... and see red box\'s moving. The red

相关标签:
1条回答
  • 2021-01-16 22:23

    Basically, The bounds of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0).

    The frame of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to the superview it is contained within.

    Please follow this link for clear example. Cocoa: What's the difference between the frame and the bounds?

    0 讨论(0)
提交回复
热议问题