IOS Cocoatouch UIKit Framework

Source: Internet
Author: User
Tags uikit

  1. Create a New button and bind a point-and-click event
    1 //Create a Button object, initialize the position size (position coordinates are the upper-left and lower-right corner points)2UIButton *btn = [[UIButton alloc] Initwithframe:cgrectmake ( -, -, -, the)];3 4 //Set button display text and style5[BTN Settitle:@"Test"Forstate:uistatecontrolnormal];6 7 //Binding Events8 //The scope object of the function that the ID and event binds to, typically the view object to which the button is joined9 //Sel- type Object for SEL-bound event functionsTen //forControlEvents The events that are bound One[Btn AddTarget: (ID) Action: (SEL) forControlEvents: (uicontrolevents)]; A  - //Adding a Button object to the View - //Self is the View object and view is the view member in the Views object the[Self.view ADDSUBVIEW:BTN];

IOS Cocoatouch UIKit Framework

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.