2
votes

I'm new to iOS 8, I tried to load a UIView from XIB file with auto layout and size classes option are enabled. I use Inferred size XIB with default size is 600 x 600. But on the simulator the size of view is not fit screen size, it still be 600 x 600 and doesn't fit the screen size like this, it's much bigger than the screen on width: enter image description here

But when I use View Controller widget, it has Resize of NIB option, and it work fine to fit the screen size. Can anybody suggest what should I do to resize UIView to fit screen size? Thank you very much, guys!

Update: Here is how I call it: enter image description here

And constraint I use: enter image description here

1

1 Answers

0
votes

You should use autolayout and set constraint. It is better choice if you need to support multiple device.

Try to figure out with these 3 images first. Then I am discussing one by one.

http://imgur.com/mE2dNm8

http://imgur.com/PVW6yrk

http://imgur.com/LLZkMgx