frame:指的是视图在父视图的坐标系统中的大小和位置。

bound:指的是视图在试图本身的坐标系统中的大小(位置起点是原点)。
center:指的是视图在父视图坐标系统中的中心点。
贴张苹果官网的图:
frame和bound的关系
下面这是其中一个发生变化,其余两个的变化,直接看吧,很浅显。

Although you can change the framebounds, and center properties independent of the others, changes to one property affect the others in the following ways:

  • When you set the frame property, the size value in the bounds property changes to match the new size of the frame rectangle. The value in the center property similarly changes to match the new center point of the frame rectangle.

  • When you set the center property, the origin value in the frame changes accordingly.

  • When you set the size of the bounds property, the size value in the frame property changes to match the new size of the bounds rectangle.

By default, a view’s frame is not clipped to its superview’s frame. Thus, any subviews that lie outside of their superview’s frame are rendered in their entirety. You can change this behavior, though, by setting the superview’s clipsToBounds property to YES. Regardless of whether or not subviews are clipped visually, touch events always respect the bounds rectangle of the target view’s superview. In other words, touch events occurring in a part of a view that lies outside of its superview’s bounds rectangle are not delivered to that view.

转载于:https://www.cnblogs.com/xubojoy/p/3873907.html

ios 的frame,bound,center相关推荐

  1. iOS学习笔记:frame,bound,center, anchorPoint

    frame: View在它的Super View坐标系里的坐标 bound: 用来定义View自身坐标系和边界的Rect,Rect的原点表示View自身坐标系的原点坐标.举个例子: 一般情况下boun ...

  2. iOS开发UI基础—手写控件,frame,center和bounds属性

    iOS开发UI基础-手写控件,frame,center和bounds属性 一.手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4 ...

  3. iOS开发UI篇—手写控件,frame,center和bounds属性

    一.手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4)如果是button等控件,还需考虑控件的单击事件等 (5)注意:View ...

  4. IOS UiView frame哪里来?

    初学ios开发,frame center bounds 一直搞不清楚.最近在看wwdc session 121 UIKit Rendering 找到答案. frame 是计算属性 frame定义是父视 ...

  5. iOS开发——frame和bounds详解

    在iOS的UI开发中,frame和bounds是两个非常容易搞混的概念,而很多开发者在实际项目中也很少去区分,因此会导致出现一些意想不到的问题.本篇博客以实际代码的方式来学习frame和bounds的 ...

  6. ios视图frame和bounds的对比

    子视图实际位置=父视图实际位置-父视图bounds坐标+子视图frame坐标 一.bounds 只影响"子视图"相对屏幕的位置,修改时不会影响自身相对屏幕的位置 bounds坐标: ...

  7. iOS中frame和Bounds之间的区别

    frame frame是每个view必备的属性,代表的是当前视图的位置和大小,没有设置他,当前视图是看不到的.位置需要有参照物才能确定,数学中我们用坐标系来确定坐标系中的某个点的位置,iOS中有他特有 ...

  8. [iOS开发]frame和bounds

    简述 Frame: 视图的位置和大小使用是父视图的坐标系,所以将视图放置在父级中这一点就很重要. Bounds:视图的位置和大小,使用的是其自己的坐标系,而对于这一点而言将视图的内容或子视图放置在其自 ...

  9. ios开发之UIView的frame、bounds跟center属性的区别(附图)

    博文暂时想到什么写什么,不顺理成章,不顺章成篇. 先看几个概念 坐标点Poit:向右侧为X轴正方向的值x,原点下侧为Y轴正方向的值y 大小Size:由宽度width和高度height构成,表示一个矩形 ...

最新文章

  1. 极客新闻——16、数据库设计中的5个常见错误
  2. LeetCode: 105. Construct Binary Tree from Preorder and Inorder Traversal
  3. 操作系统 实验3【动态分区存储管理】
  4. 阿里云服务器CentOS6.9安装jenkins
  5. 全国计算机等级考试题库二级C操作题100套(第92套)
  6. 能上网的Linux系统,那一款linux能上网
  7. Java中File操作
  8. iOS 6的Rotation
  9. Java中什么是JAP之hibernate-mvc修改功能-Springmvc
  10. sql vb xml 换行_VB中文本框换行--------急!!!
  11. 用python编写AutoCAD插件日志
  12. element中表格展开行的默认展开和收起
  13. Ubuntu20.4系统下安装kvm并创建虚拟机
  14. STM32F0xx_PWR低功耗配置详细过程
  15. 弄了一套在线教育app的源码,有兴趣的朋友可以聊聊
  16. 基于FFmpeg 实现RTSP, 音视频编解码,视频流添加文字,音视频合成MP4
  17. 视频教程-使用Objective-C进行iOS移动开发-iOS
  18. 合并财务报表及其合并范围的确定
  19. m分集2跳OFDM系统中基于功率分配和子载波配对算法的信道容量matlab仿真
  20. 10,python 数据类型,类型检查 :复数

热门文章

  1. Docker配置Dockerfile中关键ENTRYPOINT和CMD命令详解
  2. 十个提升网站访问性能的方法
  3. button上传替换file上传按钮,并显示图片缩略图,纯jsp操作
  4. 写一个在一个字符串(n)中寻找一个子串(m)第一个位置的函数。
  5. yii2不用composer使用redis
  6. HTML项目代码编写规范
  7. 个人管理:发掘自己的性格优势
  8. 站内搜索 调用方法 (谷歌 百度 雅虎)
  9. 人生没有理想,只有目标
  10. 数据结构与算法笔记(五) 链表的应用