CS193P Lecture 7

Source: Internet
Author: User

Animation, Auto layout

Views

How to draw a custom image

Gestures

How to handle user gesture actions

Views

1, it is the basic building block, represents a rectangular area on the screen, defines a coordinate space, in this space can be drawn, you can add touch events;

2, it is hierarchical level, you can nest views in the view;

3, a view has only one parent view, but can have many sub-views, the view is a rectangle, can overlap;

4, UIWindow, all views are displayed in

Self.view.window

5. Commonly used initial templates

-(void) setup{...} -(void) awakefromnib{[self setup];} -(void) initWithFrame: (cgrect) arect{    = [Super Initwithframe:arect];    [Self setup];     return Self ;}

-The initialization operation is defined in the Setup method;

-then the first is to override the specified initialization method, in which the setup is called;

-Second, Setup needs to be called in awakefromnib, because awakefromnib is called when a UIView is released from storyboard;

CGFloat

A floating-point number used to represent the image size, coordinates

Cgpoint

CGFloat x, y;

Cgsize

CGFloat width, height;

CGRect

Cgpoint origin; Cgsize size;

Coordinate origin in upper- left corner

CS193P Lecture 7

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.