您的位置:首页 > 产品设计 > UI/UE

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:





内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐