Working with iphone4 as well as iphone5 [duplicate] - iphone

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
How to create application which will work on iphone4 as well as iphone5? I am trying to understand the hurdles behind it. But I am not able to find any apple doc related to this? What kind of things we need to do for this to make app runs well on iPhone4 as well as iPhone5.
Thank you.
Please refer images bellow!
No if you refer iPhone5 image, you can see black padding on top and bottom. But if you see iPhone4 image there is no padding. I trying to ask that How can we create iPhone application which will run on iPhone4 and iPhone5 as there is height difference in iPhone5. I am trying to create new application which needs to run on both iPhone4 as well as iPhone5. I am using xcode 4.5

For the iPhone 5 you will need to support iOS 6.
Dealing with the height differacne can be solved by make the appropriate height.
You can set the autoresize mask or if you wan to support iOS 6 only, autoLayout.

Related

iOS 5 and iOS 6 - UIWebView difference in behaviour

I am testing some HTML code on UIWebView. And am also wishing to support both iOS 5.x and iOS 6.x. But there seems to be a problem about font size associated with iOS 6.x only.
That is, under rotation, iOS 5.x would make fonts slightly smaller when changing to portrait from landscape mode (which is desirable, since portrait's width is shorter). However, UIWebView in iOS 6.x would do just the opposite.
The problem does not come up when the same HTML code is rendered in iOS Safari (both 5.x and 6.x), as font size always scales as expected during rotation.
It could be something I've missed about UIWebView, hope somebody knowledgable could help to explain this.
Also, the above problem comes up on my iPhone 5 iOS 6.1 test device. Please comment if you do or don't find any similar problem. Wish to know if it is only associated with this particular phone (or its settings) only.
Latest Update :
The above problem should be related to how the project (which started long before iOS 6 was available) is laid out. As have set up a new test project with a UIWebView and a UIView in some different basic setups, and the text autosizing during rotation seems to be ok in both ios 5 & 6. The above problem may be due to custom layout adjustment code used which is good only in iOS 5. Really wish there were more compatibility between the 2 ios versions.
Please use the viewpoint setting to see the difference in ios 5 and ios 6

How to make iPhone4 and below version app compatible for iPhone5?

I have an application in iphone market which works for iPhone 4s and lower version. So now iPhone 5 has been launched which bigger size screen, my question is what all changes i have to do in my application so that it will be compatible with iPhone 5 also.
1) Do i have to rebuild my app for iPhone 5?
2) Do i have to make changes only in UI ?
3) Will the iPhone 5 will its make it compatible?
Your valuable replies will help me a lot. Thanks in advance.
Here is my answers,
1) Do i have to rebuild my app for iPhone 5?
If you want to utilize the complete screen space, you can add Default-568h#2x.png and rebuild the app and release it.
2) Do i have to make changes only in UI ?
You can utilize the complete screen space for iphone 5. You can code for screen modifications in case of other iPhones.
3) Will the iPhone 5 will its make it compatible?
Yes. It will make it automatically compatible. It will add a black strip on top and bottom to compensate for the extra space in the screen unless you add Default-568h#2x.png.
If your app uses the standard UIKit provided by Apple, you only need to add a 4 inch launch image to your app, and it will automatically resized itself. But if your app using custom controls or graphics-heavy like in games, you might want to adjust the images and take advantage of the larger screen.
You also have to make sure the methods you used do not deprecated on iOS6 to prevent the app from crashing. Some references if you need further reading.
To make older app compatible with iPhone 5 You need to look for Following things.
Latest Xcode version 4.5.
Open your project and select Upgrade settings for new version.
Add Default-568h#2x.png for new resolution .
For UI you have to change your xib's object autoresizing property.When you select View Go to
inspector and select size property It will show you None, Full Screen, Retina 4 options . Set autoresize property for all your Buttons , labels and check xib for retina 4 and None both.It is same like you set it for Landscape and portrait .
5.Some other changed will be in code because some method has been depreciated for ios 6.0.
6. After doing all this .You can run it on iphone 5 simulator for testing.
I have an app that was using GLKMatrix3 and its supporting functions. I found that the GLKMatrix3Multiply function would always crash on iPhone 5 hardware. Easy to workaround using GLKMatrix4 instead, but the point is that I would never have found the problem without actually trying my app on iPhone 5 hardware.
I was told to file a bug for the GLKMatrix3 problem, so maybe this will be fixed. But the code runs just fine in the iOS 6 simulator.
I learned from this that, whether or not you need to rebuild your app for iPhone 5, you do need to at least run your app on a device before advertising support for that device.

Bigger launch image on the 5th generation devices [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
How to deal with iPhone 5 screen size?
With 5th generation devices in the market having bigger screen, we need to have a bigger launch image (image that is shown when app icon is tapped). How would app make the difference like when to use the normal image and when to use the bigger image based on the device type?
I see a warning in my project when I build it for iPhone 6.0 simulator tap on which throws the below alert:
You need to add a launch image named Default-568h#2x.png. The compiler checks for this image and validates it. If the image is validated, your app is ready for iPhone 5 - otherwise not. Once you have the right image, follow the steps outlined in this post:
How to develop or migrate apps for iPhone 5 screen resolution?
If you are having issues with the images being used INSIDE the app, and you want to support iPhone 5 and pre-iPhone 5 devices, use this:
Dealing with different size images in a xib for iPhone5 versus iPhone4?
For short: If you want to support iPhone 5 screen you must supply launch screen for the 4" screen otherwise your app would run on 3.5" on the 4" screen.
If you put the 4" launch image that one would be used on iPhone 5 and the 3.5" one on iPhone 4 (could be different).
Please see my detailed explanation here.

app compatibility with iphone 5 screen size [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
Do any adjustments need to be made for an app started in development prior to the iphone 5 in order for them to work on the iphone 5's larger screen?
If so, what are these changes, or where can I find what to change? google hasn't been too helpful so far.
Thanks
After adding the Default-568h#2x.png launch image, follow the steps outlined in this post:
How to develop or migrate apps for iPhone 5 screen resolution?
If you are having issues with the images being used INSIDE the app, and you want to support iPhone 5 and pre-iPhone 5 devices, use this:
Dealing with different size images in a xib for iPhone5 versus iPhone4?
You need to add a default launch images with 640x1136px named Default-568h#2x.png to support the iPhone 5 screen.
First, you have to have a 640x1136 launch image (with -568h#2x.png suffix) to make it compatible with the iPhone 5, but to fully make use of the larger screen, there are a many ways to do it. I find the easiest way to do it is to make two separate storyboards, making a new one for the iPhone 5, while maintaining the one you have already used for the iPhone 4S, 4, etc. Using two storyboards removes the necessity for AutoLayout; enabling AutoLayout, it is good to note, also removes iOS 5 compatibility. Use the code in this answer to get started.
Depending on how your app views are laid out, you may not need to make too many changes. If you have views that resize and are anchored correctly, such as scroll views or table views, they will expand to fill the additional space on the iPhone 5 screen. You need to add an additional launch image for the new screen size too.
the iphone 5's screen is taller so you'd need to have images with a resolution of 1136x640 also included in your images folder. (add -568h#2x at the end of image's filenames)
also, everytime you will adjust your sprites and everything else that goes on the screen, you will need to account for the iphone 5 separately, just like you account for the ipad and the iphone (non retina and retina).

iPhone 5 Applications (4 inch Screen) [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
I'm (still) trying to convert one of my iPhone applications to iPhone 5, but it still looks like this in the simulator...
What am i doing and why won't it fill up the entire screen?
Have you provided a 4" sized launch image? That's the indicator that tells the OS that your application supports the full screen.
Have you selected in your UIView attributes inspector in XCode iPhone 5 screen size?
Please have a look at the url,
iPhone 5 TabBar not functioning in proper position
Now, in xib, at the right side, under 'Interface Builder Document', put a tick-mark on use autolayout and fix your objects in xib accordinlgy.
Download and install Xcode 4.5 GM. Set a 4-inch launch image for
your app. This is how you get 1136px screen height (without it, you
will get 960px with black margins on top and bottom).
Test your app, and hopefully do nothing else, since everything should work magically if you had set auto resizing masks properly. If you didn't, adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward.
Also note: The auto-rotation API has changed completely, take a look at that as well if your application supports any rotation other than default.