国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

UIView的常見屬性

2019-11-14 18:04:49
字體:
供稿:網(wǎng)友
UIView的常見屬性:@interface UIView : UIResponder<NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem>/** *  通過一個frame來初始化一個UI控件 */- (id)initWithFrame:(CGRect)frame;// YES:能夠跟用戶進(jìn)行交互@PRoperty(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  // default is YES// 控件的一個標(biāo)記(父控件可以通過tag找到對應(yīng)的子控件)@property(nonatomic)                                 NSInteger tag;                // default is 0// 圖層(可以用來設(shè)置圓角效果/陰影效果)@property(nonatomic,readonly,retain)                 CALayer  *layer;@end@interface UIView(UIViewGeometry)// 位置和尺寸(以父控件的左上角為坐標(biāo)原點(0, 0))@property(nonatomic) CGRect            frame;// 位置和尺寸(以自己的左上角為坐標(biāo)原點(0, 0))@property(nonatomic) CGRect            bounds;// 中點(以父控件的左上角為坐標(biāo)原點(0, 0))@property(nonatomic) CGPoint           center;// 形變屬性(平移/縮放/旋轉(zhuǎn))@property(nonatomic) CGAffineTransform transform;   // default is CGAffineTransformIdentity// YES:支持多點觸摸@property(nonatomic,getter=isMultipleTouchEnabled) BOOL multipleTouchEnabled;   // default is NO@end@interface UIView(UIViewHierarchy)// 父控件@property(nonatomic,readonly) UIView       *superview;// 子控件(新添加的控件默認(rèn)都在subviews數(shù)組的后面, 新添加的控件默認(rèn)都顯示在最上面/最頂部)@property(nonatomic,readonly,copy) NSArray *subviews;// 獲得當(dāng)前控件所在的window@property(nonatomic,readonly) UIWindow     *window;// 從父控件中移除一個控件- (void)removeFromSuperview;// 添加一個子控件(可以將子控件插入到subviews數(shù)組中index這個位置)- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;// 交換subviews數(shù)組中所存放子控件的位置- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;// 添加一個子控件(新添加的控件默認(rèn)都在subviews數(shù)組的后面, 新添加的控件默認(rèn)都顯示在最上面/最頂部)- (void)addSubview:(UIView *)view;// 添加一個子控件view(被擋在siblingSubview的下面)- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;// 添加一個子控件view(蓋在siblingSubview的上面)- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;// 將某個子控件拉到最上面(最頂部)來顯示- (void)bringSubviewToFront:(UIView *)view;// 將某個子控件拉到最下面(最底部)來顯示- (void)sendSubviewToBack:(UIView *)view;/**系統(tǒng)自動調(diào)用(留給子類去實現(xiàn)), 這些方法就可以叫做"事件方法", 由系統(tǒng)調(diào)用。**/- (void)didAddSubview:(UIView *)subview;- (void)willRemoveSubview:(UIView *)subview;- (void)willMoveToSuperview:(UIView *)newSuperview;- (void)didMoveToSuperview;- (void)willMoveToWindow:(UIWindow *)newWindow;- (void)didMoveToWindow;/**系統(tǒng)自動調(diào)用**/// 是不是view的子控件或者子控件的子控件(是否為view的后代)- (BOOL)isDescendantOfView:(UIView *)view;  // returns YES for self.// 通過tag獲得對應(yīng)的子控件(也可以或者子控件的子控件)- (UIView *)viewWithTag:(NSInteger)tag;     // recursive search. includes self/**系統(tǒng)自動調(diào)用(留給子類去實現(xiàn))**/// 控件的frame發(fā)生改變的時候就會調(diào)用,一般在這里重寫布局子控件的位置和尺寸// 重寫了這個寫方法后,一定調(diào)用[super layoutSubviews];- (void)layoutSubviews;@end@interface UIView(UIViewRendering)// YES : 超出控件邊框范圍的內(nèi)容都剪掉@property(nonatomic)                 BOOL              clipsToBounds;// 背景色@property(nonatomic,copy)            UIColor          *backgroundColor; // default is nil// 透明度(0.0~1.0)@property(nonatomic)                 CGFloat           alpha;                      // default is 1.0// YES:不透明  NO:透明@property(nonatomic,getter=isOpaque) BOOL              opaque;                     // default is YES// YES : 隱藏  NO : 顯示@property(nonatomic,getter=isHidden) BOOL              hidden;// 內(nèi)容模式@property(nonatomic)                 UIViewContentMode contentMode;                // default is UIViewContentModeScaleToFill@end@interface UIView(UIViewAnimationWithBlocks)+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations;+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;@end

 

 

 


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 阳山县| 青田县| 南城县| 武宣县| 富顺县| 阜南县| 留坝县| 航空| 庄浪县| 通化县| 博客| 孝感市| 兴文县| 长丰县| 潞西市| 桐柏县| 闵行区| 酒泉市| 伽师县| 潜江市| 绥化市| 梅河口市| 泽普县| 隆德县| 长子县| 广德县| 曲靖市| 策勒县| 邛崃市| 萨嘎县| 甘孜县| 东台市| 金昌市| 樟树市| 莫力| 德惠市| 昌图县| 新干县| 建始县| 建湖县| 手游|