PHPz2017-04-17 13:52:08
The method is to add constraints (autolayout)
Here is an example, the steps are as follows:
1) The podfile file of cocoaPod is as follows
2) StoryBoard adds subview View1 as follows
3) The xib to be loaded is as follows
4) The viewcontroller loads the XIB onto a view and constrains its size. The code is as follows:
5) The running results are as follows
Supplement: If you want to adapt to the screen size, just change self.View1 to self.view in the 4) code accordingly~
Also, what does jumping to XIB mean? Does it mean loading? Please describe the topic as clearly as possible so that others can help you. .