What's the difference between frame and layout in Interface builder's size inspector?

前端 未结 2 483
渐次进展
渐次进展 2020-12-23 11:35

In IB, there is a dropdown in Size Inspector showing \"Layout\" and \"Frame\". I know what a frame is, but I don\'t know what the layout is in this case. What is the diffe

2条回答
  •  借酒劲吻你
    2020-12-23 11:55

    Many built-in IB elements have a separate "layout" versus "bounds" rectangle. You can see the difference by showing them using the "Layout>Show XXX Rectangles". The drop-down indicates which rectangle the coordinates refer to.

    On Mac, this impacts UITextFields that are labels for example. If you switch between Layout and Frame, the X coordinate will change by 3 pixels. I haven't played with iPhone controls to see if it impacts any of them. It doesn't come up a lot.

提交回复
热议问题