gpt4 book ai didi

objective-c - NSView 的边界与框架

转载 作者:IT老高 更新时间:2023-10-28 11:39:59 26 4
gpt4 key购买 nike

边界和框架有什么区别?事实上,为什么会存在“界限”? 'bounds' 的大小等于框架的大小,并且边界的原点应始终为 0,0。

最佳答案

来自View and Window Architecture iOS 编程指南:

A view object tracks its size and location using its frame, bounds, and center properties:

The frame property contains the frame rectangle, which specifies the size and location of the view in its superview’s coordinate system.

The bounds property contains the bounds rectangle, which specifies the size of the view (and its content origin) in the view’s own local coordinate system.

The center property contains the known center point of the view in the superview’s coordinate system.

这是该解释的一个很好的可视化:

enter image description here

关于objective-c - NSView 的边界与框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8496762/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com