UIView is not resizing on iPhone 5 Simulator [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?
I have UIViewController with a view that is 320x480. I made autoresizing mask setup for UIView to stretch it horizontally and vertically. But when I run it on iPhone 5 simulator there are black space at top and bottom.
Why UIView is not resized automatically from 480 to 568 pixels (vertically) to fill the empty space ?

You need to add Default-568h#2x.png launch image to your project with 1136x640px resolution.
See here:
How to develop or migrate apps for iPhone 5 screen resolution?

Related

UIScreen.main.bounds wrong value on iphone X emulator [duplicate]

This question already has answers here:
Seeing black bars at the top and bottom of the iPhone X Simulator
(11 answers)
Closed 5 years ago.
I'm trying to adapt an app to run on the iPhone X's screen but the UIScreen.main.bounds.size is always returning 375x667 and it should return 375x815.
I am running on a iPhone X simulator and everything works fine, except for this, so I am having a hard time on positioning elements on the screen as the wrong height is read.
I forced the height to be 710 just to see how it behaves.
Take a look at the picture and you will observe 2 crazy things:
The banner is cropped by the black area;
The corners of the app are rounded even with the black stripes.
You need to add Launch screen for iPhone X. Which size is Portrait size 1125px × 2436px & Landscape size 2436px × 1125px
Hope it helps!

issue with iphone5 [duplicate]

This question already has answers here:
How to develop or migrate apps for iPhone 5 screen resolution?
(30 answers)
Closed 9 years ago.
The new iPhone 5 display has a new aspect ratio and a new resolution (1136 x 640 pixels).
What is required to develop new or transition already existing applications to the new screen size? I have already added the splash screen which works for the 4-inch retina display. But still I am getting the 88 pixel gap in the top and bottom of my application screens.
NOTE: I have enabled AutoLayout. But some of the components in my classes are created by XIB and some of them by writing code in the implementation file.
If I enable Auto layout then how should I resize the objects that are been created programatically Please concentrate on the bold lines and provide a solution to me. My UI is very complex and that's why I am not choosing the two XIB's concept for different screen sizes.
If you enable Auto Layout, then for the views that you create in code - you might add NSLayoutConstraints to them (then be sure to set -translatesAutoresizingMaskIntoConstraints to NO).
if ([UIScreen mainScreen].bounds.size.height >= 568)
{
// rotationView.frame = CGRectMake(0, 0, rotationViewWidth, rotationViewHeight+88);
}
add this code to your code under where you want to match the new iPhone5 aspect,then rotationView is need to modify . rotationViewHeight add 88,and y modified similar
Controller : AViewController *aViewContrller = [[AViewController alloc] initWithNibName:(iPhone5?#"AViewController-5":#"AViewController") bundle:nil];

Launch image for iPhone applications [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've a question about the launch image of an iPhone app. Until now in my app's I included two launch app images: Default.png (320 x 480) and Default#2.png(640 x 960), the first one for normal resolution and the second one for high resolution.
The question is that, with the new iPhone 5, the high resolution image should have a size of 640 x 1136? If yes, how this image will be shown in an iPhone4? In the iPhone4 an image of 640 x 1136 size is shown centered? or not?
Thank you
include 3 images now
320x480 - Default.png
640x960 - Default#2x.png
640x1136 - Default-568h#2x.png
-- the one used is based on screensize

Iphone5: Black screen appearing at the top and bottom when running ios5 application on ios6 [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
PhoneGap and iPhone 5: Remove top and bottom black stripes
Please enlighten me on this.
When i run my ios5 app on ios6 retina 4 inch simulator i can see a black screen at the top and bottom of the simulator. please help me in resolving this issue..
You must include a default splash screen image for iPhone 5. This acts as a flag, tells the device that your app is set up for the 4 inch display.
name of image must be: Default-568h#2x.png

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.