UIView frame bounds center tag 相关知识及区别
2014-05-13 17:11
399 查看
@property(nonatomic) CGRect frame; @property(nonatomic) CGRect bounds; @property(nonatomic) CGPoint center;
CGRect:
struct CGRect {
CGPoint origin;
CGSize size;
};
typedef struct CGRect CGRect;CGPoint:
struct CGPoint {
CGFloat x;
CGFloat y;
};
typedef struct CGPoint CGPoint;CGSize:
struct CGSize {
CGFloat width;
CGFloat height;
};
typedef struct CGSize CGSize;
frame: 用来描述视图的大小和位置,其中的CGPoint是从屏幕的左上角作为(0,0)。
bounds:也是用来描述视图的大小和位置,不过他的CGPoint是从自身的左上角作为(0,0)。
区别:
center: 顾名思义,就是视图的中心。
tag:屏幕有很多的视图,为了便于区分,添加不同的tag区分视图。
相关文章推荐
- Oracle 数据库相关知识 ---------- DML、DDL、DCL 命令区别
- 硬件相关基础知识2(NOR Flash和NAND Flash的区别)
- ost 与pst的区别 及 exchange 相关知识
- 面试之jsp、Servlet相关知识——生命周期, 区别等
- CPU相关知识-寄存器与存储器的区别
- 面试之jsp、Servlet相关知识——生命周期, 区别等
- Cookie与session的区别及各自的相关知识浅谈
- 面试之jsp、Servlet相关知识——生命周期,区别等
- 硬件相关基础知识1(IIC和SPI的区别)
- 硬件相关基础知识0(EEPROM和flash的区别)
- 理论基础知识之————KB Kb Kbps 相关单位的区别和换算
- 面试之jsp、Servlet相关知识——生命周期, 区别等
- 了解相关.NET Framework不同组件区别及安装知识
- 面试之jsp、Servlet相关知识——生命周期, 区别等
- 课外相关知识补充(自学笔记)
- 关于内存管理单元需要掌握的相关知识
- 一文让你彻底了解iOS字体相关知识
- 寄存器、RAM、ROM、Flash相关概念区别整理
- LVS 相关理论知识
- JavaScript网页编程之------数组相关知识