Learn iPhone uikit (1)

Source: Internet
Author: User

Learn iPhone uikit (1)

1. Do not use the hello World Program of interface builder. Write the Code as follows:

In addition, to delete the mainwindow. XIB file, delete the item "Main NIB file base name" in the info. plist file.

2. the position and size of the uiview are as follows:

Use the frame or center attribute

:

(1) The code comments the code set for the center.

(2) The code set by the center and the code set by the frame are not commented out.

(3) The code set for frame is commented out, and nothing can be seen.

3. Use the sizetofit method to adapt the uiview content.

4. Affine Transformation:

5. nested uiview:

The code for the button action is as follows:

:

6. Code for inserting and deleting child elements:

(1) The effect is as follows:

(2) Exchange results, code:

(3) Delete child 3 code:

7. Search by adding tags and uiview. Code:

:

** Note: @ selector (searchdidpush) has no colon !!!

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.