To adjust the view of the xib file to the screen size

Asked 2 years ago, Updated 2 years ago, 61 views

I created an xib file in InterfaceBuilder with iphone-4inch (width:320px, height:568px).I addSubView that View with ViewController, but it is 4 inches in size no matter which terminal I simulate.How do I fit the screen?

ios xib

2022-09-30 14:29

1 Answers

If the entire screen is OK,

subView.frame =self.view.frame;
[self.view addSubView: subView];

I think it's okay to
If you set AutoLayout for the content in subView, it won't look bad.


2022-09-30 14:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.