Xcode 6: How to make an image view fill the screen on all devices? Auto layout not working?

后端 未结 4 1574
孤独总比滥情好
孤独总比滥情好 2020-12-22 22:27

So I have an image view and a button. I need the image view to be the correct size (not look squished or stretched) on all devices and more importantly I need it to be the s

4条回答
  •  余生分开走
    2020-12-22 23:21

    Not sure I understand "exactly" what you're after but if you want to drag an image view into the controller, and that image view to automatically fill the whole view controller background: just drag the image view component into the view controller window.

    Thing is: if you see a blue bounds line around the view controller, before you drag, the image view won't fill the view controller.

    You need to click anywhere on the background in the view controller pane, so the blue bounds line disappears, only then, will the image view you're dragging in, fill the whole controller background automatically.

    If you find, using previews, your pics are getting squished or stretched, then, just go to the "Resolve Auto Layout Issues" menu, and click "Add missing constraints" - then all should resize to look ok on all screens.

提交回复
热议问题