Question

I'm creating a universal app. Everything is looking great on the ipad/iphone but when I switch my storyboard view to the iphone 5 or run the simulator as the iphone 5, there is an inch or so at the bottom of just whitespace. I've tried turning on autolayout and using that, but with no luck. I've also tried to create -568h@2x.png versions of my images to see if it will auto-resize with those, but it doesn't. Does anyone have any other ideas I could perhaps try?

Thank you!

Was it helpful?

Solution

I found the way to fix this was to use the AutoResizing box in the size inspector in Xcode. It's the box with the red lines. The red box next to it animates to show you how it changes as the view (the white box) changes size. This changes the autoresizingMask in the storyboard. You can make the image scale or not or keep distance to an edge: Just click on the different red lines to see how the red box changes. I had to do this for every button and image in the game.

You also need to check 'Autoresize Subviews' in the parent view in the Attributes Inspector.

And you do need Default-568h@2x.png to get rid of the letterbox in the first place.

OTHER TIPS

If you a simple application using table views and detail views and just want t expand screen height. Try this: 1. open up your mainstoryboard_iphone as source 2. look for autorisizingMask element: `" **

key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>** "`
. It should be somewhere in the viewController element "view" i.e.:



<view key="view" contentMode="scaleToFill" id="UrG-Iu-edE">
                        <rect key="frame" x="0.0" y="20" width="320" height="460"/>
                        **<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>**    
3. and change into: 

**<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>**

For me there was no need to use another storyboard.

You can try clicking on the view, going to the attributes inspector, and selecting "Retina 4 Full Screen". You'll have to manually resize the things inside your view though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top