A period of time did not knock the code, some of the previous simple will not do, rummaging and trouble, so it is recorded.
1. Open the project and create a new class AAA that inherits from UIView;
2, create a blank xib, the same name AAA
3. Associate Xib with UIView, click File's Owner, class to select AAA view.
---》
4, pull a view on the Xib, set the background bit red, call this uiview on the controller, test the effect, the normal display after running.
// Call the Xib view, AAA *av =[[[nsbundle mainbundle]loadnibnamed:@ "aaa" owner:self Options:nil] Lastobject]; // Set Size Av.frame = CGRectMake (+); // Add a View [Self.view Addsubview:av];
Two: Pull TableView on the Xib view. and set the proxy, agent settings, it should be noted that the implementation of the proxy method is in the controller, not in the UIView
The table is displayed normally after running, but if the controller is added to the navigation bar, the table header will be empty.
IOS adds xib to UIView