1 UIView
1.1 Creating a custom UIView xib file
[1] Setting the class in the custom class of file ' s owner to execute the customized control classes
[2] Setting the screen size of the current UIView
Simulated Metrics Size is Freefrom, other bar options are set to None
[3] Two ways to load custom controls are implemented
-(ID) initWithFrame: (CGRect) frame//general how to set the frame build control in code
-(ID) Initwithcoder: (Nscoder *) Adecoder//build control via Xib file load mode
-(void) awakefromnib
[4] Gets the current control's frame
Self.frame;
[5] Getting a custom nib control in a custom control
nsbundle* Bundle=[nsbundle Mainbundle];
views= [Bundle loadnibnamed:@ "UIMainMenuButton1" owner:self Options:nil];
uiview* Uiview=[views objectatindex:0];
[6] Setting custom properties
To add a custom property to a class
Select the class in the Xib file that adds the custom class and add the user defined runtime attributes in the show the Identity Inspector Tab
[7] The custom control cannot calculate the actual width height of the current control, but the system comes with controls such as Uilabel can calculate the actual width of the height,
Must be height, and width in auto layout settings
[8] Cut content
Set Clips subviews selected
2 Auto Layout
[1] Show file inspector in the Xib file, select Use Auto layout
[2] adding constraints to controls
From the menu item Editor-->pin
Bottom right selection of Xib interface
[3] Common constraints, length and width
The distance from the four sides of the parent container
Aligns horizontally, vertically, relative to the parent container,
Relative to other controls, length, width equal, left, right, middle alignment, top, bottom, alignment, transverse interval, longitudinal interval
[4] Editing a constraint that modifies any of the current controls
Select the control directly, double-click and modify it, depending on the constraint line displayed in the panel
Select the control, view show the Size Inspector panel, display the current constraint, and modify
[5] Common interface setting size is 4.7 inch
iOS Interface layout Finishing