`
chenniaoc
  • 浏览: 39869 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

difference between frame and bounds Property

 
阅读更多
bounds
The bounds rectangle, which describes the view’s location and size in its own coordinate system.

@property(nonatomic) CGRect bounds
Discussion
On the screen, the bounds rectangle represents the same visible portion of the view as its frame rectangle. By default, the origin of the bounds rectangle is set to (0, 0) but you can change this value to display different portions of the view. The size of the bounds rectangle is coupled to the size of the frame rectangle, so that changes to one affect the other. Changing the bounds size grows or shrinks the view relative to its center point. The coordinates of the bounds rectangle are always specified in points.

Changing the frame rectangle automatically redisplays the receiver without invoking the drawRect: method. If you want the drawRect: method invoked when the frame rectangle changes, set the contentMode property to UIViewContentModeRedraw.

Changes to this property can be animated.

The default bounds origin is (0,0) and the size is the same as the frame rectangle’s size.



frame
The frame rectangle, which describes the view’s location and size in its superview’s coordinate system.

@property(nonatomic) CGRect frame
Discussion
This rectangle defines the size and position of the view in its superview’s coordinate system. You use this rectangle during layout operations to size and position the view. Setting this property changes the point specified by the center property and the size in the bounds rectangle accordingly. The coordinates of the frame rectangle are always specified in points.

Warning If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.
Changing the frame rectangle automatically redisplays the receiver without invoking the drawRect: method. If you want the drawRect: method invoked when the frame rectangle changes, set the contentMode property to UIViewContentModeRedraw.

Changes to this property can be animated. However, if the transform property contains a non-identity transform, the value of the frame property is undefined and should not be modified. In that case, you can reposition the view using the center property and adjust the size using the bounds property instead.
分享到:
评论

相关推荐

    iOS view的frame和bounds之区别.pdf

    在iOS开发中,视图(UIView)的frame和bounds是两个非常重要的属性,它们都是CGRect类型,包含了视图的位置和大小信息。但是这两个属性在概念和使用上有所区别,了解这些差异对于开发iOS应用至关重要。 首先,frame...

    使用BoundsChecker检测内存泄漏

    使用BoundsChecker检测内存泄漏 BoundsChecker 是一种用于检测内存泄漏的工具,它采用 Code Injection 技术来截获对内存分配和释放函数的调用。下面是 BoundsChecker 的工作原理和实现细节: BoundsChecker 工作...

    BoundsChecker

    BoundsChecker是一款著名的软件调试工具,尤其在C++编程领域中被广泛应用。它的主要功能是帮助开发者检测程序中的内存越界问题,这是一种常见的编程错误,可能导致程序崩溃、数据损坏或者安全漏洞。内存越界通常发生...

    BoundsChecker使用说明

    ### BoundsChecker使用说明 #### 一、BoundsChecker简介 BoundsChecker是一款高级的运行时错误检测工具,主要用于识别和定位程序运行期间出现的各种错误。这款工具能够显著提高在Visual C++等开发环境下的软件开发...

    内存泄露检测工具boundschecker11.rar

    BoundsChecker是一款由Compuware公司开发的著名内存泄露检测工具,专用于帮助程序员发现和修复这类问题。这款工具以其强大的功能和易用性在IT行业内得到了广泛的认可。 BoundsChecker 11版本可能是该工具的一个特定...

    内存泄露检查工具BoundsChecker

    BoundsChecker是一款著名的内存泄露检查工具,尤其在C++编程领域中被广泛使用。这款工具由NuMega公司开发,后来被Compuware公司收购,主要用于帮助开发者在开发过程中发现和修复内存管理问题。 BoundsChecker通过...

    Boundschecker 9.01破解

    Boundschecker 9.01破解 C:\Program Files\Common Files\Compuware\libdlm32.dll 替换

    用BoundsChecker检查内存泄漏

    ### 使用BoundsChecker检查内存泄漏与指针越界 在软件开发过程中,尤其是使用C++进行编程时,内存管理是一项至关重要的任务。不当的内存管理可能导致内存泄漏和指针越界等严重问题,这些问题可能在短期内不会立即...

    Bounds Checker6.01 for Delphi

    BoundsChecker automatically pinpoints static, stack and heap memory errors, and resource leaks. Unlike ordinary memory-checking tools, BoundsChecker validates the latest Windows APIs including ...

    BoundsChecker11.03 Part2

    BoundsChecker11.03 Part2,可支持最新VS2015

    BoundsChecker 教程

    BoundsChecker 是一款强大的运行时错误检测工具,专为C++开发者设计,用于发现并解决程序在执行阶段可能出现的各种错误。该工具集成了Visual C++开发环境,通过自动调试处理器帮助开发者快速定位和修复问题,从而...

    BoundsChecker v7.2.zip

    BoundsChecker是一款著名的软件调试工具,尤其在C++和.NET应用程序的开发中被广泛使用。它由Compuware公司开发,后来被DevPartner Studio所吸收。 BoundsChecker的主要功能是帮助开发者检测程序中的内存错误、资源...

    DevPartner for Visual C++ BoundsChecker Suite 11.3.1812.0 (4)

    The 11.3 release tackles the latest Microsoft development platform Visual Studio 2015 and Operating System Windows 10, while keeping true to its BoundsChecker roots set in native development. ...

    BoundsChecker 6.01 及 9.1种子

    BoundsChecker Visual C++ Edition 是...8.2 - 2007年5月 - 最新版本完全的支持 Visual Studio 6.0 and Visual Studio .NET 2003。 5.0 - 1997年3月。 4.0 - 1996年 - 引入API验证功能。 2.0 for DOS - 1991年3月。

    List index out of bounds(-1)错误解决办法

    解决办件运行弹出List index out of bounds错误.

    google-maps-coordinates-tile-bounds-projection

    Addressing tiles: same tile bounds with different indexes There are three main systems of tile adressing: Google XYZ, Microsoft QuadTree and from the open-source world comming TMS (Tile Map Service).

    BoundsChecker11.03 Part3

    BoundsChecker11.03 Part3,可支持最新VS2015

Global site tag (gtag.js) - Google Analytics