Easy use of iOS development UI Chapter-xib

Source: Internet
Author: User

First, Brief introduction

Comparison of Xib and storyboard, a lightweight one heavyweight.

Common:

is used to describe the software interface

are edited using the Interface Builder tool.

Different points:

Xib is lightweight and is used to describe the local UI interface

Storyboard is a heavyweight, a multi-interface for describing the entire software, and the ability to show jump relationships between multiple interfaces

Second, the simple use of xib

1. Create a Xib file

The created Xib file is named Appxib.xib

2. Set the Xib

Adjust the view to a free layout, depending on the needs of the program

Create a view model (set length and width parameters)

Adjust the layout and internal controls

Single View after completion

3.1

Take out xib view        nsarray  *apparray= [[NSBundle mainbundle]loadnibnamed:@ "Appxib" Owner:nil         options:nil];58 UIView *appview=[apparray Firstobject]; Gets the first array element object, which is Uiimageview



4.

Example of wiring a xib

1. Wiring Example

Create a new view class for Xib, inherited from UIView


Associating the new view class in the upper-right corner of the Xib interface

Connect the xib with the view class

Note: In use, change the weak to a strong reference. Otherwise...

Easy use of iOS development UI Chapter-xib

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.