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