//獲得自己的父控件對象@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的幾個常見屬性
待續................................
新聞熱點
疑難解答