Cocoa: What's the difference between the frame and the bounds?

后端 未结 11 2254
温柔的废话
温柔的废话 2020-11-22 08:00

UIView and its subclasses all have the properties frame and bounds. What\'s the difference?

11条回答
  •  遇见更好的自我
    2020-11-22 08:15

    The frame is the rectangle that defines the UIView with respect to its superview.

    The bounds rect is the range of values that define that NSView's coordinate system.

    i.e. anything in this rectangle will actually display in the UIView.

提交回复
热议问题