Detailed parsing of UIView header files in iOS

Source: Internet
Author: User

@interface uiview:uiresponder<nscoding, Uiappearance, Uiappearancecontainer, uidynamicitem>

/**

* Initialize a UI control with a frame

*/

-(ID) initWithFrame: (CGRect) frame;

YES: Ability to interact with users

@property (nonatomic,getter=isuserinteractionenabled) BOOL userinteractionenabled; Default is YES

A tag for the control (the parent control can find the corresponding child control via tag)

@property (nonatomic) nsinteger tag; Default is 0

Layer (can be used to set fillet effect \ Shadow effect)

@property (Nonatomic,readonly,retain) Calayer *layer;

@end

@interface UIView (Uiviewgeometry)

Position and size (in the upper-left corner of the parent control is the coordinate origin (0, 0))

@property (nonatomic) cgrect frame;

Position and size (in its own upper left corner as the origin of the coordinates (0, 0))

@property (nonatomic) cgrect bounds;

Midpoint (in the upper-left corner of the parent control is the coordinate origin (0, 0))

@property (nonatomic) Cgpoint Center;

Deformation properties (pan \ Zoom \ Rotation)

@property (nonatomic) Cgaffinetransform transform; Default is Cgaffinetransformidentity

YES: Multi-touch support

@property (nonatomic,getter=ismultipletouchenabled) BOOL multipletouchenabled; Default is NO

@end

@interface UIView (Uiviewhierarchy)

Parent control

@property (nonatomic,readonly) UIView *superview;

Child control (the newly added control defaults to the Subviews array, and the newly added control is displayed by default on top \ Topmost)

@property (nonatomic,readonly,copy) Nsarray *subviews;

Gets the window where the current control is located

@property (nonatomic,readonly) UIWindow *window;

Removing a control from a parent control

-(void) Removefromsuperview;

Add a child control (you can insert a child control into the Subviews array, index this position)

-(void) Insertsubview: (UIView *) View Atindex: (nsinteger) index;

Swap the position of the child controls held in the Subviews array

-(void) Exchangesubviewatindex: (Nsinteger) index1 Withsubviewatindex: (Nsinteger) Index2;

Add a child control (the newly added control defaults to the Subviews array, and the newly added control is displayed by default on top \ Topmost)

-(void) Addsubview: (UIView *) view;

Add a child control view (blocked under Siblingsubview)

-(void) Insertsubview: (UIView *) View Belowsubview: (UIView *) Siblingsubview;

Add a child control view (cover on top of Siblingsubview)

-(void) Insertsubview: (UIView *) View Abovesubview: (UIView *) Siblingsubview;

Pull a child control to the top (topmost) to display

-(void) Bringsubviewtofront: (UIView *) view;

Drag a child control to the bottom (the bottommost) to display

-(void) Sendsubviewtoback: (UIView *) view;

/** System Automatic Call (leave subclass to implement) **/

-(void) Didaddsubview: (UIView *) Subview;

-(void) Willremovesubview: (UIView *) Subview;

-(void) Willmovetosuperview: (UIView *) Newsuperview;

-(void) Didmovetosuperview;

-(void) Willmovetowindow: (UIWindow *) NewWindow;

-(void) Didmovetowindow;

/** system automatically calls **/

is not a child control of a view or child control (whether it is a descendant of a view)

-(BOOL) Isdescendantofview: (UIView *) view; Returns YES to self.

To get the corresponding child control (or child control of child controls) by tag

-(UIView *) Viewwithtag: (nsinteger) tag; Recursive search. Includes self

/** System Automatic Call (leave subclass to implement) **/

The control's frame is called when it is changed, and the location and dimensions of the layout child control are typically overridden here

After rewriting this write method, be sure to call [Super Layoutsubviews];

-(void) layoutsubviews;

@end

@interface UIView (uiviewrendering)

YES: Content that extends beyond the bounds of the control 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: Show

@property (Nonatomic,getter=ishidden) BOOL hidden;

Content mode

@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

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.