app can't distinguish screen size [duplicate] - ios

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to deal with iPhone 5 screen size?
How can I add support for 4-inch iPhone 5 displays to an iOS app in Xcode?
Is this even possible with the latest public Xcode release, v4.4.1?

Add a new launch image named Default-568h#2x.png to your project and it will work!

If your application is iOS6 only, the easiest way to make views that layout correctly in both 3.5-inch and 4-inch iPhone 5 designs is to use AutoLayout in your XIBs to make them adapt their size automatically (See the WWDC'2012 video sessions about that). If your application must support versions prior to iOS6, then you can still use AutoResizingMasks on your views to make them resize themselves to adapt to both 3.5 and 4 inch screens.
Then for your application to support the 4-inch display and take the whole screen when launched on an iPhone 5, simply add a "Default-568h#2x.png" launch image to your project.
The simple presence of this launch image will make your application launch full-screen on iPhone 5 instead of having black bands at the top and bottom.

Short answer : use the new launch image slot ( the Retina 4-inch ) one in XCode->Targets->Summary->iPhone/iPod Deployment Info
I have an OpenGL ES 2 app that despite all options I checked, nothing worked. Creating a new GLGame project adds black launch images for Retina 3.5 inch and Retina 4 inch. Despite every other comparison to project settings or .plist file I found nothing else to say "make it available for iPhone 5". I sure hope this changes in the future.

Related

iOS View Controller size is 4 inch on iPhone 6

I have iPhone oriented application, the UI created using a storyboard, when I run it on 4.7 or 5.5 inch devices it presented as 4 inch screen with black empty space on top and bottom of window.
The project was created on Xcode 6 and I got the issue when I compile it with Xcode 7 but I'm not sure if it's related.
On Xcode 7 you must add the launch screens (on "images.xcassets") of your desired resolution (iphone6 , iphone5...) or instead you can add the splash screen that automatically will work for all resolutions (YourProjectName/General/App Icons and Launch Images).
Hope this helps.
You haven't add added Launch Images with proper resolution in proper place. So your app is considering it only for iphone5 not above so.Place launch Images properly.It will help.Thanks
Here are Apple's answers:
If you don't use launch images, but you do have a Launch Screen (nib
or storyboard) then we synthesize your launch screen at install time.
If you don't have any launch images, and you don't have a launch nib
or storyboard, then you are declaring that you don't support any
screen sizes aside from 320x480
A brand new project should not demonstrate any of these issues
With the iPad Pro you will need a Launch Screen to support the new
screen size (and you need Launch Screens to support multitasking on
iPad in general).

how to get a normal keypad on iphone 6 and 6 plus

I'm building an app that works fine on iphone 5. When I look at it on a iphone 6 or 6 plus however, I see that the keypad is stretched, basically zoomed in. I'm using autolayout and storyboards.
What do I need to set in order to make the keyboard scale to a normal size?
You need to ensure that the app is optimized to run in the native resolution of these devices, rather than the zoomed compatibility mode. This can be done by setting a properly-sized launch image for the iPhone 6/6+.
These launch images will be labeled Retina HD 4.7 and Retina HD 5.5 in your launch images file, respectively. If you do not see these options available in your launch image assets, create a new launch image set and they should be there.

Do I really have to explicitly support iPhone 6 and iPhone 6 Plus screens?

I couldn't get used to introduced in Xcode 6 new layout system called Size Classes, so I decided to go by the old way creating two separate xibs for iPhones and iPads with ~iphone and ~ipad suffixes correspondingly.
Xibs designed for iPhones (with view size in IB equal to 320x568) works perfectly for new iPhone 6 and iPhone 6 Plus screens, and iPhone 6 plus even loads #3x assets if I provide those.
The first question, do I really have to add launch storyboard to indicate that my app supports new iPhones, or I can go without it?
If I add them all my xibs designed for iPhone 4s / 5 will stop working for iPhone 6 and 6 plus.
The second question, do I really have to provide #3x assets set? iPhone 6 uses #2x assets set, iPhone 6 plus in case of the absence of #3x images upscales #2x images in a very smooth way so that I cannot determine any pixellation.
I'm interested, in particular, whether Apple will reject the app, or maybe not add some kind of "Optimized for iPhone 6 Plus" badge to the app, or any other penalties?
Using a launch file only works for iOS 8+, so if you're targeting iOS 7+, you'll still need static launch images to support iOS 7 anyway.
Other than a few required launch images and icons, providing higher resolution images (e.g. #2x) within your app has always been optional.
Use the scale modes on image views to automatically scale the images to fit.
You'll need to provide static launch images or a launch file for the new iPhone 6 screens or your app won't get the "Optimized for iPhone 6" text on your app page in the App Store.

How can I tell if a Springs and Struts app is scaling in the iPhone 6 simulator?

I have a couple applications built pre-auto-layout (but w/ Springs and Struts to support iPhone 5+) that I'm trying out in the iPhone 6 and 6 Plus simulator and they actually look quite good. However, I can't tell if the Springs and Struts are actually doing their job so-to-speak or if they're just being scaled. There must be some obvious thing I'm missing where it says which? Also, do auto-layout apps just automatically convert when recompiled with the latest SDK for iPhone 6 so they're not just scaling as long as 3X artwork is provided (in the case of 6 Plus)?
You can easily see, if your app runs in scaled mode by outputting the bounds and the native bounds screen of the main screen:
println("bounds = \(UIScreen.mainScreen().bounds)")
println("nativeBounds = \(UIScreen.mainScreen().nativeBounds)")
Without a designated launch images the output of the iPhone 6 Plus Simulator is:
bounds = (0.0,0.0,320.0,480.0)
nativeBounds = (0.0,0.0,960.0,1440.0)
The native bounds are 3 times the scaled bounds. This is the reason behind the #3x display.scale.
In case of the iPhone 6 Plus nativeScale also helps:
println("main screen native scale = \(UIScreen.mainScreen().nativeScale)")
println("main screen scale = \(UIScreen.mainScreen().scale)")
nativeScale will always be 3.0. scale will be 2.0 if the simulator does scaling.
To get a comprehensive understanding of the new resolutions see this great blog entry: http://www.paintcodeapp.com/news/iphone-6-screens-demystified
Use a different launch image for iPhone 6, iPhone 6 Plus and all the rest.
If you see a specific lunch image you know your app is not scaled and that it is running in the device's native resolution.
The only way I was able to tell was to go home and see if the status bar text was smaller than it was in my app. A smaller home screen status bar implies it is being scaled. If the status bar text is the same size within your app in the iPhone 6 sim as it is on the home screen of the simulator, then it is using your springs/struts or autolayout instead of scaling

How to create the UI for different devices in iOS? [duplicate]

This question already has an answer here:
Xcode5 ( 3.5" screen to 4 inch )
(1 answer)
Closed 8 years ago.
I'm working with an iOS application in which i uses the different controllers with 4 inch screen sizes.
I'm done with my application. Now it is the requirement that it also runs on the 3.5 inch screen like on iPhone 4S. I am using the auto layout. How can i do it?
This is my first application.So I have a little knowledge about UI.
My requirement is that when I run the same application on iPhone 4S with 3.5 inch screen size, it needs to be reset automatically with 3.5 inch.
Please help me out.
Use the iOS Simulator, that will give you an idea of how the application will turn out (Whilst you're in in choose Hardware -> Device -> iPhone Retina (3.5 inch).
You can adjust elements in interface builder to scale to different elements on the screen under the view tab. Try using the view tab (looks like a ruler) and specify the origin and scaling there.

Resources