UIView的常见属性和代码创建UIButton
2017-02-13 14:54
387 查看
UIView的常见属性:
1. superview
l @property(nonatomic,readonly)UIView *superview;
l 获得自己的父控件对象
2. subviews
l @property(nonatomic,readonly,copy)NSArray *subviews;
l 获得自己的所有子控件对象
3. tag
l @property(nonatomic) NSInteger tag;l 控件的ID\标识,父控件可以通过tag来找到对应的子控件
4. frame
l @property(nonatomic)CGRect frame;
l 控件所在矩形框的位置和尺寸(以父控件的左上角为坐标原点)
5. bounds
l @property(nonatomic)CGRect bounds;
l 控件所在矩形框的位置和尺寸(以自己左上角为坐标原点,所以bounds的x\y永远为0)
6. center
l @property(nonatomic)CGPoint center;
l 控件中点的位置(以父控件的左上角为坐标原点)
7. transform
l @property(nonatomic)CGAffineTransform transform;
l 控件的形变属性(可以设置旋转角度、比例缩放、平移等属性)
代码创建UIButton:
相关文章推荐
- 01-UIView的常见属性及方法 以UIButton为例
- IOS开发-代码创建UI控件并修改控件属性(代码创建UIButton、UILabel)
- iOS学习笔记 4 —— 代码创建界面UIView、UILabel、UITextField、UIButton
- ISOUI控件--创建画板,UIView,UILable,UITextField,UIButton基本属性
- 创建UIButton常见格式
- Android 在Java代码中设置style属性--使用代码创建ProgressBar对象
- Silverlight反编译系列二常见代码(自动生成属性CompilerGenerated,代码)
- [代码]使用函数构造创建具有属性的元素(LINQ to XML)
- IIS代码管理(2):创建应用程序池和属性 (转自:孟子E章)
- JavaScript动态创建div属性和样式示例代码
- Android 在Java代码中设置style属性--使用代码创建ProgressBar对象
- IIS代码管理(2):创建应用程序池和属性
- Android 在Java代码中设置style属性--使用代码创建ProgressBar对象
- Python代码中os.path常见属性的相关介绍 from 路人甲
- Python代码中os.path常见属性的相关介绍 from 路人甲
- Android 在Java代码中设置style属性--使用代码创建ProgressBar对象
- JavaScript 常见对象类创建代码与优缺点分析
- IIS代码管理(2):创建应用程序池和属性
- Android 在Java代码中设置style属性--使用代码创建ProgressBar对象
- 附:MySQL常见错误代码说明 1005:创建表失败 1006:创建数据库失败 1007:数据库已存在,创建数据库失败 1008:数据库不存在,删除数据库失败 1009:不能删除数据库文件导