View goes out of order when change screen size ios - ios

I am developing an app for ios. When I build it on simulator for 3.5 inch retina it works fine because I designed it for that in Interface Builder. But when I change simulator from 3.5 inch to 4 inch, components goes out of order. Here I have share snapshots:
3.5 Retina Image
Table view is highlighted in red box.
Retina 4 inch
Size of table view is increased but button is at old position. This is my problem.
Any suggestions?

Follow steps:
1. Go to your xib file
2. Select UITableView control from XIB
3. Then remove auto resizing mask from right side section
refer screen shot

Related

iPhone simulator no longer displaying 4 inch display correctly

When I set my emulator for 3.5 inch it works fine. It use to work fine when I changed it to 4 inch. Now the emulater is the size of a 4 inch screen. Inside is the screen set up for a 3.5 inch, where it has black top and bottom margin. It looks like the 3.5 inch display is being drawn in the center of the 4 inch screen.
My back up still works, but I would loose a lot of code I added to it.
You need to have Default-568h#2x.png as your launch image to support 4 inch display. You also need your code to adjust for the larger screen size.

Support of iPhone 4-inch screen by storyboard

I created a new project in XCode 5. And I run it on iPhone 5 (which has 4" screen) and a view doesn't cover all screen, but rather squeezed in 3.5" box (there are two black bars around my view)
I went to Main_iPhone.storyboard and checked that:
Use Autolayout is turned on on View Contoller
Use Autolayout is turned on on View
I tried Simulated Metrics, Size: Retina 4-inch Full Screen, Freeform and Inferred.
I tried to use button at the button to switch to Retina 4-inch form factor and 3.5-inch form factor.
Nothing makes a difference and it still shown as 3.5" (black bars around my view).
How can I make sure that iPhone storyboard occupies whole screen on iPhone 4-inch phone?
Update 1
None of solutions in this question: Xcode Storyboard displaying the new iPhone 5 screen size? solved my problem. BTW. That question was for pre XCode 5.
To enable your apps to work with iPhone 5, I suggest you to do two things.
First you need to add a retina version of the launcher image. It should be named Default-568h#2x.png.
And second use Auto Layout and make sure you have your autoresizing mask set up correctly for all your views.
I had the same problem, could not resolve it by any of the above methods. So what I did is copied the Content.json files from old project (where 4-inch was working) into the Images.xcassets Applcon.appiconset and LaunchImage.launchimage directories respectively. Then selected in the project setting in General under App Icon selected Source as AppIcon and in Launch Images in Source selected LaunchImage. It worked. Maybe useful to someone.

Displaying different images for iPhone 4 & 5

This seems to be an interesting problem that I'm getting. I'm developing an iPhone app for iOS 6+ devices and optimizing the images for both iPhone 4 & 5. Now I have implemented this into my project: Xcode 4.5 background image iPhone 4, 4s, 5
The problem is in interface builder I'm designing the UI with the iPhone 5 screen, so the UIImageView is 320x568. But when I test on iPhone 4, the image is being stretched and looks terrible. However, the specified image for the iPhone 4 screen is displaying, i just want its dimensions to be 320x480
Hope someone can help!
From the inspector view in the interface builder, you can edit the stretching behavior of the view when the size of the super view changes. You can click the red arrows inside the square to control that.
Also I suggest that you check UIView contentMode. You can edit that from the inspector view in the interface builder "third tab from the right.
In the UIImageView's inspector, try playing with the Mode property. The Aspect Fill or Aspect Fit may get what you're looking for to handle the different screen sizes.

Two storyboards for different iPhones (3,5 and 4')

I write application for a 3.5-inch on one storyboard and for 4 inches in another stroryboard. As a delegate at startup check under what device is enter in and from there method can be carrying launch storyboard or iphone 4 or iphone 5
(because the larger screen iphone 5, can I expands the functionality?)
Is it correct?
You don't have to do this. There is a button in the bottom left of interface builder that lets you switch between screen sizes, and using autosizing will adjust it for both screen sizes.
You can also use Autolayout too

Simulator/device UI differs from storyboard

I am using Xcode 4.5.1 to create a very simple, single view iPhone app. I've laid out the view as you can see in the IB image. (UIViewController, UIView, UIButton, UITextView).
When I run the app in the simulator (or my phone) it looks like the second screen shot.
I don't understand why the simulator UI doesn't look like the one I created in IB.
What am I missing?
Thanks!
If you look you are using the iPhone 5 size layout in your storyboard file. To change the dimensions between iPhone 5 layout and the standard iPhone size
Click on the icon in the lower right hand corner of the storyboard:
Alternatively, if you want to see the layout in a iPhone 5 simulator. In the iOS simulator go to Hardware > Device > iPhone (Retina 4-inch). This is the iPhone 5 layout. However, if you do not have a retina displayed computer. The iPhone will look like a really big iPad.
It looks like you have an iPhone 5 sized layout in Xcode and a iphone 4 in simulator. Check the constraints on the dark grey vs bottom views and make sure that they'll resize how you want.
Hey so here is another method.
My Problem:
1.My Storyboard was showing a fat rectangle that didnt look anything like a iPhone. Then when I'd run the simulator all the element were cut off and not in the right position.
2.Simulator took up the whole screen.
Resolution:
1. Make sure you Storyboard is open and displayed, click on the frame so that it has a blue highlighted border. Then on the Utilities manager (on the right) click on "Show the Attributes menu". The very first item should be Simulated Metrics. Choose the size that best fits your screen/needs.
2.Follow Adjusting the XCode iPhone simulator scale and size I scaled it down to 33%
Best,
Nate

Resources