ios 的frame,bound,center
frame:指的是视图在父视图的坐标系统中的大小和位置。
Although you can change the frame
, bounds
, 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 thebounds
property changes to match the new size of the frame rectangle. The value in thecenter
property similarly changes to match the new center point of the frame rectangle.When you set the
center
property, the origin value in theframe
changes accordingly.When you set the size of the
bounds
property, the size value in theframe
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相关推荐
- iOS学习笔记:frame,bound,center, anchorPoint
frame: View在它的Super View坐标系里的坐标 bound: 用来定义View自身坐标系和边界的Rect,Rect的原点表示View自身坐标系的原点坐标.举个例子: 一般情况下boun ...
- iOS开发UI基础—手写控件,frame,center和bounds属性
iOS开发UI基础-手写控件,frame,center和bounds属性 一.手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4 ...
- iOS开发UI篇—手写控件,frame,center和bounds属性
一.手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4)如果是button等控件,还需考虑控件的单击事件等 (5)注意:View ...
- IOS UiView frame哪里来?
初学ios开发,frame center bounds 一直搞不清楚.最近在看wwdc session 121 UIKit Rendering 找到答案. frame 是计算属性 frame定义是父视 ...
- iOS开发——frame和bounds详解
在iOS的UI开发中,frame和bounds是两个非常容易搞混的概念,而很多开发者在实际项目中也很少去区分,因此会导致出现一些意想不到的问题.本篇博客以实际代码的方式来学习frame和bounds的 ...
- ios视图frame和bounds的对比
子视图实际位置=父视图实际位置-父视图bounds坐标+子视图frame坐标 一.bounds 只影响"子视图"相对屏幕的位置,修改时不会影响自身相对屏幕的位置 bounds坐标: ...
- iOS中frame和Bounds之间的区别
frame frame是每个view必备的属性,代表的是当前视图的位置和大小,没有设置他,当前视图是看不到的.位置需要有参照物才能确定,数学中我们用坐标系来确定坐标系中的某个点的位置,iOS中有他特有 ...
- [iOS开发]frame和bounds
简述 Frame: 视图的位置和大小使用是父视图的坐标系,所以将视图放置在父级中这一点就很重要. Bounds:视图的位置和大小,使用的是其自己的坐标系,而对于这一点而言将视图的内容或子视图放置在其自 ...
- ios开发之UIView的frame、bounds跟center属性的区别(附图)
博文暂时想到什么写什么,不顺理成章,不顺章成篇. 先看几个概念 坐标点Poit:向右侧为X轴正方向的值x,原点下侧为Y轴正方向的值y 大小Size:由宽度width和高度height构成,表示一个矩形 ...
最新文章
- 极客新闻——16、数据库设计中的5个常见错误
- LeetCode: 105. Construct Binary Tree from Preorder and Inorder Traversal
- 操作系统 实验3【动态分区存储管理】
- 阿里云服务器CentOS6.9安装jenkins
- 全国计算机等级考试题库二级C操作题100套(第92套)
- 能上网的Linux系统,那一款linux能上网
- Java中File操作
- iOS 6的Rotation
- Java中什么是JAP之hibernate-mvc修改功能-Springmvc
- sql vb xml 换行_VB中文本框换行--------急!!!
- 用python编写AutoCAD插件日志
- element中表格展开行的默认展开和收起
- Ubuntu20.4系统下安装kvm并创建虚拟机
- STM32F0xx_PWR低功耗配置详细过程
- 弄了一套在线教育app的源码,有兴趣的朋友可以聊聊
- 基于FFmpeg 实现RTSP, 音视频编解码,视频流添加文字,音视频合成MP4
- 视频教程-使用Objective-C进行iOS移动开发-iOS
- 合并财务报表及其合并范围的确定
- m分集2跳OFDM系统中基于功率分配和子载波配对算法的信道容量matlab仿真
- 10,python 数据类型,类型检查 :复数