< geek College > Video Tutorial Learning Notes-ios use of Calayer

Source: Internet
Author: User

<1>calayer Introduction

1, Calayer is generally used as a container for UIView.

2, Calayer is a manager picture carrier (image-based content) layer structure

3, directly modify the properties of the Calayer created by the individual can trigger an implicit animation

4. Calayer animation in UIView must be explicitly triggered to take effect

Opening code exercises:

1 #import "ViewController.h"2 3 @interfaceViewcontroller ()4 //2 Create a layer individually5@property (nonatomic,strong) Calayer *layer;6 7 @end8 9 @implementationViewcontrollerTen  One- (void) Viewdidload { A [Super Viewdidload]; -     //1 Creating a container view -UIView *containerview = [[UIView alloc] Initwithframe:cgrectmake ( -, $, -,3)]; theContainerview.backgroundcolor =[Uicolor Bluecolor]; - [Self.view Addsubview:containerview]; -     //3 using and setting the relevant values for the layer -Self.layer =[Calayer layer]; +[Self.layer Setframe:cgrectmake (0,0, -,3)]; -Self.layer.backgroundColor = [Uicolor Redcolor]. Cgcolor;//don't forget to have another one at the end. Cgcolor + [Containerview.layer AddSublayer:self.layer]; A } at  -  - @end

< geek College > Video Tutorial Learning Notes-ios use of Calayer

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.