Difference between view's frame and view's bound + iPhone

前端 未结 3 1634
小蘑菇
小蘑菇 2021-01-04 01:13

I want to know what is the difference between \'frame\' and \'bound\' property of UIView. I get the same results using both properties. I can not figure out the difference b

相关标签:
3条回答
  • 2021-01-04 01:42

    The frame is the view's location in its superview, using the superview's coordinate system.

    The bounds is the view's location and size in its own coordinate system.

    If you are getting the same results for both properties, it means that the view fills its superview, and both views have (0, 0) as the origin. Try changing the frame, and you will see it move to different positions within its superview.

    0 讨论(0)
  • 2021-01-04 01:45

    This is covered in the documentation. The frame and bounds are two different coordinate systems.

    0 讨论(0)
  • 2021-01-04 01:58

    I know its too late but as this a common question so I am posting a link to apple documentation to have a detailed explanation on this

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