App runs on iphone 5 like iphone 4 - iphone

I have finally done to build Augmented Reality app.
The app works great for iphone 4 screen size Width :480 Height :320.
During the development I have also test the simulator to see launch goes well for 4 inch display (iphone 5), and it did go well the splash screen show was the 4 inch png named : Default-568h#2x.png and the screen shows a white background fully (like it should).
When I launch the app on a real iphone 5 device, the 3.5 inch splash screen loaded and the app load like it loads on iphone 4. Everything in the middle and I get a little black equal Margins from the side, the cable is original and this is the Weirdest thing ever happened to me.
UPDATE : i have also tried to add this code on the simulator and to the real device :
CGRect bounds = [[UIScreen mainScreen]bounds];
NSLog(#"%#",NSStringFromCGRect(bounds));
the simulator prints iphone 5 screen size, the real device prints iphone 4 size.
Any help please

Make sure you have all three Launch images set up correctly. :)

Make sure the image has been added to the target.
=> If you select your image file in the Project Navigator (left pane) the Utilities pane (right pane) should have a checkmark under 'Target Membership' next to your target.

I think that your views need to resize. You may need to include some code that detects what device the person is using and resizes the view. Just a suggestion.

Related

Black bars showing when running app on iOS 7 (4 inch retina display)

We have an iPod app built with base SDK as 5.1.
App has a tabBarController with three tabs and each tab has a UIViewController to load a different view.
The app works fine for iOS 6.1 and iOS 7 (3.5 inch display) simulator and device but when we run the app on
iOS 7 (4 inch display simulator) or device we are getting black bars at the top and bottom of the view screen in all three tabs.
If anyone can suggest reason for this or some feasible solution to this problem, it would be really helpful for us.
Thanks
First thing is that you must add the required default image for 4 inch screen display. Check Properly in you project have image with name Default-568h#2x.png (640 × 1136 pixels)
This Default-568h#2x.png is Necessary for Support app in 4 inch Screen display
Ones you add this image in to you working Project, Remove old Build from device or Simulatore, clear Project and re build and check Hope you issue will solve.
Edit:-
After fix the black Bar issue you can check the device like my answer Give here check this:-
Detect device type
you have two choice if you can't use AutoLayout
First
Create two xib with same class one for 3.5 inch screen and one for 4 inch screen set using macro with checking which screen appear.
Second
Set Self.view frame using macro with checking which screen appear.
There are also other methods you can use for set self.view frame as using window frame or UIScreen
My problem was I accidentally deleted the value found here:
I added back LaunchScreen, and made sure there was a LaunchScreen.xib. Maybe it will help some others.
Ive had the same problem - black bars at the top and bottom. It was simply solved by setting the drop down in "App Icons and Launch Images" to Main_iPhone:
App Icons and Launch Images Screen Shot
I was facing same problem . I just added launch image and it worked for me.
XCode->Click on Project File -> Select Target-> App Icons and Launch Images -> Add launch image source
This worked!
Pay attention to Step#5 and Step#6 below:
1.In xcode, Click on the Project file in Project Navigator
2.Click General tab
3.Type "Main_iPhone" in the Launch Screen File field
4.Save
5.Remove the app from device or simulator
6.Then in Xcode go to Product Menu and then select Clean
7.Build again

View for Retina 3.5 displayed like Retina 4

I would like to have an iPhone app only for Retina 3.5. For one of my views I set Size to "Retina 3.5 Fill Screen". I added a toolbar to this view.
However, when I run the app on iPhone 5 the view is displayed Full Screen (like on Retina 4) and the toolbar is somewhere in the middle of the view.
Here are my settings from the XCode:
And here is a screenshot from my iPhone 5:
Any thought how can I make sure that the view is displayed as Retina 3.5 on iPhone 5 ?
Is there any particular reason why you don't want it to work for the 4 inch display? For iPhone five users (at least for me anyways) having an app that isn't built for the larger display is the most annoying thing ever. Those users pay to have more screen real estate and not making an app for them isn't taking advantage of that extra screen real estate. Also, apple made auto layout to be more versatile. This means in the future there are going to be even more screen sizes coming up, so sooner or later you will have to learn how to make the apps behave correctly using auto layout.

3.5" ios app screens get messed up on 4" screen

My first app got accepted and uploaded onto the app store today :)
I download it onto my 4s (iphone with a 3.5 inch screen size) it is PERFECT!!
But when i download the app onto my iphone 5 (iphone with 4 inch screen size) the pictures are all out of place and moved around on the screen (as if the images are being stretched. How can i fix this? I dont have time right now to redo all of the art work. I just want the black bars to be on the top and bottom. How can i achieve this? Thanks a bunch guys!
Remove the Retina (4-inch) launch image from the project navigator (although it would be better to provide an 4-inch version of your app :p ).

iPhone 5 not displaying app properly

I am testing some old apps on the iPhone 5 simulator. Most of the apps display properly, that is the display centered, maintaining the original iPhone aspect with blank space on the top and bottom.
One of my apps acts differently. It stretches the launch image (an old 2:3 aspect launch image) to the full height top to bottom of the iPhone 5 simulator. Then it snaps the app to the top of the window, as opposed to centering it.
I suspected this had something to do with auto-layout, but as far as I can tell, being new to the concept, it is disabled. As I checked in the file inspector and "use auto layout" is unselected.
Any thoughts? Thanks for reading!
Removing Default-568h#2x.png from the project should solve the problem. It seems like several people have been having a problem with Xcode auto-creating this launch image.
From my experience it looks like when you open a project in XCode 4.5 it automatically adds a flag to each view saying "Autoresize subviews" and by default this is set to true. When I disable this flag for all my views, they no longer stretch. Interestingly though, I don't get the letterboxing in the simulator, instead a get a white band at the bottom.
I ended up manually setting up the views for the iPhone 5 because I could not locate or fix the issue. Setting up the views specifically for the iPhone 5 was relatively easy, but frustrating to not know why it was necessary in this case.
I detected the iPhone 5 using the code below found in this stack overflow answer: How to detect iPhone 5 (widescreen devices)?
#define IS_IPHONE_5 ( [ [ UIScreen mainScreen ] bounds ].size.height > 500)
if (IS_IPHONE_5 ) {
//set up views
}
Remove the Default-568h#2x.png from the project, and also, you must manually remove the app from the simulator before running it again from Xcode. It looks like ios6 saves some kind of a flag for the installed apps that makes it think it should stretch it.
Simply removing the Default-568h#2x.png did not solve my problem.
First I deleted this file, than I drag a 640x1136 image to the "Launch images - Retina (4-inch)" of "iPhone Deployment Info" section in Xcode.
In iOS 7 Sdk if your are not added launch image in your project you need to
Add launch image (640 X 1136 and 640 X 960)into your project, Then go to General Tab and set both launch image (Retina, Retina 4 inch) then remove app from simulator and run again should solve the problem

Default picture for iPhone 4

How shall I manage to make a default image for my iphone application that is large enough for the Retina screen? The screenshots I take with the Organizer in XCode is 320px x 480px, however how can I manage to get a screenshot twice as large? It is just a picture of the UINavigationBar, empty area in the middle and a UITabBar at the bottom with all content removed.
Thanks in advance.
To take a simulator screenshot, use Ctrl+Apple+C. Then paste the image into Preview (menu/File/New from clipboard) and save. That will give you just the screen, sans the iPhoney window border. If you want one with the border, use Grabber.
For a Retina emulator, set the simulator to iPhone 4 mode. Menu/Hardware/Device/iPhone (Retina). Just tried - it works.
The easiest way is to run the app on a retina device and press both buttons at the same time to take a screenshot.
However, if you don't have access to a retina device, there is a great FREE program here: http://www.curioustimes.de/iphonesimulatorcropper/ that can take screenshots directly from the simulator. For Retina images make sure your simulator is set to iPhone 4 and that your screen resolution is set high enough to display it in Retina.
I appreciate the help, however I do not have a Mac/PC that has the resolution that I need to display the iPhone 4 simulator properly(high resolution, apparently). If you have, the answers given is perfect, however my solution was to download this:
http://www.teehanlax.com/blog/2010/08/12/iphone-4-gui-psd-retina-display/
and then resize components to 640px x 960px (minus the statusbar).