Things to keep in mind in Xib and storyboard in iOS development

Source: Internet
Author: User

Precautions for using xib:

1. Only a control with a view can use xib because it is itself a view

2. When adding a property (code) using a visual control, if you delete the property code, be sure to disassociate it on the xib (or it will crash)

3. When you use Xib to customize the cell, you must register the cell in the code

Precautions for using storyboard:

1.storyboard and Xib use, are biased to the interface of the settings, a lot of data manipulation functions are still required code.

2. Stroyboard does not need to register when defining the cell, but must add identifier (reuse identifier) to the visual interface

Precautions for using AutoLayout:

< three buttons in the lower right corner >

AutoLayout: To add constraints, each control requires at least four constraints (width, height, position of the x-axis, distance from the y-axis)

1. In general, click the middle button to constrain the size of the controls. Then click on the controls and control + mouse on the interface to add constraint lines to the collision boundary. It is to fix the X and Y axes, horizontally (horizontal), left,

Right is generally used to determine the x-axis

2. If a constraint line is added, the control's position and size are changed on the visual interface, and a constraint conflict occurs. Resolving conflicts requires updating the constraint (update to the latest location and size) or updating the frame (before returning to the location and size of the change)

Things to keep in mind in Xib and storyboard in iOS development

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.