Common properties and methods of UIView

Source: Internet
Author: User

Common properties and methods of UIView

-(void) viewdidload{[Super Viewdidload];    Temporary view UIView *temp = [[UIView alloc] init];    Temp.frame = CGRectMake (0, 0, 100, 100);                [Self.view addsubview:temp]; Common attribute//1 for UIView.        Get your own parent control [temp Superview]; 2.            Get all of your child control objects [temp subviews]; 3.            The ID of the control is identified, and the parent control can find the corresponding child control through the tag value [temp settag:9999]; 4.    The deformation properties of the control (you can set the rotation angle, scale, pan, and so on) Temp.transform = Cgaffinetransformmakerotation (m_pi_2);  Rotation-this angle is the radian system M_pi m_pi_2 m_pi_4 ...  A positive number is a clockwise negative number that is counterclockwise temp.transform = Cgaffinetransformmaketranslation (20,30);      X-direction X-Direction Y-shift (plus or minus can control direction) Temp.transform = Cgaffinetransformmakescale (20,40); Zoom and expand//5 in the X and y directions.        The position and dimensions of the control's rectangle box in the parent control (the origin of the coordinates in the upper-left corner of the parent control) [temp frame]; 6.        The position and size of the control's holding box (the origin of the coordinates in its upper-left corner, so bounds X, Y is generally 0) [temp bounds]; 7.                The position of the midpoint of the control (in the upper-left corner of the parent control is the coordinate origin), you can define the position of the control [temp Center]; The common method of UIView is//1. Add a child control//UIView *tempview = [[UIView alloc] init];//[selF.view Addsubview:tempview]; 2.            Remove the [temp Removefromsuperview] from the parent control; 3. Find the corresponding control (typically a child control) based on a tag identifier [Self.view viewwithtag:9999];}

·

----ICode, love life.

Common properties and methods of UIView

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.