"Objective-c study record" 38th Day

Source: Internet
Author: User

Custom views are now a bit confusing, with a rough idea of how to write:

1. Create a new view controller that designates this view controller as the root View Controller for window

2. Customize the view Ltview, explicitly ltview the internal controls, declare the properties, override the initWithFrame: Layout method, and first add the child view. Improve the display effect, you need to define an initialization method, the parameter is the display property of the view

3. Custom views, explicit internal controls, declared as properties, overriding initWithFrame: layout methods, adding child views

4. Inside the view controller, override the Loadview method to specify a blank view of the view controller as a custom view (or you can not establish a custom view in the View controller's Viewdidload method, load the view, refine the view controller)

5. Set the proxy for the input box inside the view controller and add an event for the button.

And don't forget the memory management

Then is the newly learned to some touch method, iOS will touch into three time periods:

1. Touch Start

-(void) Touchesbegan: (Nsset<uitouch *> *) touches withevent: (Uievent *) event;

2. Touch Mobile

-(void) touchesmoved: (Nsset<uitouch *> *) touches withevent: (Uievent *) event;

3. Touch End

-(void) touchesended: (Nsset<uitouch *> *) touches withevent: (Uievent *) event;

"Objective-c study record" 38th Day

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.