Common Properties of UIView and common properties of UIView

Source: Internet
Author: User

Common Properties of UIView and common properties of UIView

 
Common Properties of UIView: @ interface UIView: UIResponder <NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem>/*** initialize a UI control using a frame */-(id) initWithFrame :( CGRect) frame; // YES: interaction with users @ property (nonatomic, getter = isUserInteractionEnabled) BOOL userInteractionEnabled; // default is YES // a tag of the control (the parent control can find the corresponding child control through the tag) @ property (nonatomic) NSInteger tag; // default is 0 // layer (can be used to set the rounded corner effect \ shadow effect) @ property (nonato Mic, readonly, retain) CALayer * layer; @ end @ interface UIView (UIViewGeometry) // position and size (using the upper left corner of the parent control as the coordinate origin (0, 0 )) @ property (nonatomic) CGRect frame; // position and size (starting from the coordinate origin (0, 0) in the upper left corner) @ property (nonatomic) CGRect bounds; // midpoint (with the upper left corner of the parent control as the coordinate origin (0, 0) @ property (nonatomic) CGPoint center; // deformation attribute (Pan, zoom, or rotate) @ property (nonatomic) CGAffineTransform transform; // default is CGAffineTransformIdentity // YES: supports multi-point touch @ property (nonatomic, Getter = isMultipleTouchEnabled) BOOL multipleTouchEnabled; // default is NO @ end @ interface UIView (UIViewHierarchy) // parent control @ property (nonatomic, readonly) UIView * superview; // subcontrol (the newly added control is all behind the subviews array by default, and the newly added control is displayed at the top \ top) @ property (nonatomic, readonly, copy) NSArray * subviews; // obtain the window @ property (nonatomic, readonly) UIWindow * window of the current control; // remove a control from the parent control-(void) removeFromSuperview; // Add a child control (you can insert the child control to the su Location of the index in the bviews array)-(void) insertSubview :( UIView *) view atIndex :( NSInteger) index; // switch the location of the Child control in the subviews array-(void) exchangeSubviewAtIndex :( NSInteger) index1 withSubviewAtIndex :( NSInteger) index2; // Add a child control (the newly added controls are all behind the subviews array by default, by default, all newly added controls are displayed at the top \ top)-(void) addSubview :( UIView *) view; // Add a subcontrol view (blocked under siblingSubview) -(void) insertSubview :( UIView *) view belowSubview :( UIView *) siblingSubview; // Add Subcontrol view (built on the siblingSubview)-(void) insertSubview :( UIView *) view aboveSubview :( UIView *) siblingSubview; // pull a subcontrol to the top (top) -(void) bringSubviewToFront :( UIView *) view; // pull a sub-control to the bottom (bottom) to display-(void) sendSubviewToBack :( UIView *) view; /** automatically called by the system (left to the subclass for Implementation). These methods can be called "event methods" and called by the system. **/-(Void) didAddSubview :( UIView *) subview;-(void) willRemoveSubview :( UIView *) subview;-(void) willMoveToSuperview :( UIView *) newSuperview;-(void) didMoveToSuperview;-(void) willMoveToWindow :( UIWindow *) newWindow;-(void) didMoveToWindow; /** automatically called by the system ** // is the view subcontrol or the subcontrol of the subcontrol (whether it is the descendant of the view)-(BOOL) isDescendantOfView :( UIView *) view; // returns YES for self. // obtain the corresponding sub-control through tag (or the sub-control of the sub-Control)-(UIView *) viewWithT Ag :( NSInteger) tag; // recursive search. includes self/** automatically called by the system (left to the subclass for implementation) ** // when the frame of the control changes, it will be called, generally, after the position and size of the layout sub-control are overwritten here, you must call [super layoutSubviews];-(void) layoutSubviews; @ end @ interface UIView (UIViewRendering) // YES: The content beyond the control's border is cut off @ property (nonatomic) BOOL clipsToBounds; // background color @ property (nonatomic, copy) UIColor * backgroundColor; // default is nil // transparency (0.0 ~ 1.0) @ property (nonatomic) CGFloat alpha; // default is 1.0 // YES: opaque NO: transparent @ property (nonatomic, getter = isOpaque) BOOL opaque; // default is YES // YES: hide NO: display @ property (nonatomic, getter = isHidden) BOOL hidden; // content mode @ property (nonatomic) UIViewContentMode contentMode; // default is expired @ end @ interface UIView (synchronized) + (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) interval :( NSTimeInterval) duration delay :( NSTimeInterval) delay interval :( CGFloat) dampingRatio initialSpringVelocity :( CGFloat) velocity options :( UIViewAnimationOptions) options animations :( void (^) (void )) animations completion :( void (^) (BOOL finished) completion; @ end
 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.