Properties of iOS View

Source: Internet
Author: User

UIView provides a number of ways to manage views

Add a view to a view
Addsubview:
Move a view to the front
Bringsubviewtofront:
Push a view to the back
Sendsubviewtoback:
To remove a view
Removefromsuperview
Insert a view and specify an index
Insertsubview:atindex:
Insert View above a view
Insertsubview:abovesubview:
Insert view under a view
Insertsubview:belowsubview:
Swap views for two-position indexes
Exchangesubviewatindex:withsubviewatindex:

Creating UIView Animation blocks

Cgcontextref context = Uigraphicsgetcurrentcontext ();
Mark Animation start
[UIView Beginanimations:nil Context:context];
Define how the animation accelerates or decelerates
[UIView Setanimationcurve:uiviewanimationcurveeaseinout];
Defines the duration of the animation 1 seconds
[UIView setanimationduration:1.0];
Intermediate processing position change, size change, rotation, etc.
[[Self.view viewwithtag:999] setalpha:1.0f];
Flag Animation block End
[UIView commitanimations];
You can also set callbacks
[UIView setanimationdelegate:self];
To set methods for callback calls
[UIView setanimationdidstopselector: @selector (animationfinished:)];


  1. //Set the border of the layer to round feet  ?
  2. mywebview.layer.cornerradius = 8
  3. MYWEBVIEW.LAYER.MASKSTOBOUNDS = YES;  
  4. //Add a colored border to the layer ?         
  5. MyWebView.layer.borderWidth = 5;?
  6. MyWebView.layer.borderColor = [[Uicolor colorwithred:0.52Green:0.09Blue:0.07Alpha:1] cgcolor];?
  7. }

Properties of iOS View

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.