//获得自己的父控件对象@PRoperty(nonatomic,readonly) UIView *superview;//获得自己的所有子控件对象@property(nonatomic,readonly,copy) NSArray *subviews;//控件的ID/标识,父控件可以通过tag来找到对应的子控件@property(nonatomic) NSInteger tag;//控件的形变属性(可以设置旋转角度、比例缩放、平移等属性@property(nonatomic) CGAffineTransform transform;
//控件所在矩形框在父控件中的位置和尺寸(以父控件的左上角为坐标原点)@property(nonatomic) CGRect frame;//控件所在矩形框的位置和尺寸(以自己左上角为坐标原点,所以bounds的x/y一般为0)@property(nonatomic) CGRect bounds;//控件中点的位置(以父控件的左上角为坐标原点)@property(nonatomic) CGPoint center;
//label显示的文字@property(nonatomic,copy) NSString *text;//文字字体大小@property(nonatomic,retain) UIFont *font;//文字的颜色@property(nonatomic,retain) UIColor *textColor;//文字的排列方式(左对齐、居中、右对齐)枚举值@property(nonatomic)NSTextAlignment textAlignment;// 设置行数(行数==0代表自动换行)@property(nonatomic) NSInteger numberOfLines;
// 所要显示的图片@property(nonatomic,retain) UIImage *image;// 设置序列帧动画数组(按顺序播放animationImages数组中的图片)@property(nonatomic,copy) NSArray *animationImages;// 序列帧动画的持续时间@property(nonatomic) NSTimeInterval animationDuration;// 序列帧动画的执行次数(默认是0,代表无限循环)@property(nonatomic) NSInteger animationRepeatCount;
// 表示UIScrollView所滚动的位置@property(nonatomic) CGPoint contentOffset;// 表示UIScrollView的内容尺寸(能滚动的范围)@property(nonatomic) CGSize contentSize;// 增加UIScrollView额外的边缘滚动区域@property(nonatomic)UIEdgeInsets contentInset;// 代理@property(nonatomic,assign) id<UIScrollViewDelegate>delegate;
下图介绍了UIScrollView的几个常见属性
待续................................
新闻热点
疑难解答