iOS View Controller size is 4 inch on iPhone 6 - ios

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).

Related

iOS old application screen size

I have old application in iOS and I haven't been involved in development since 1 year.I have built it in iOS 7. Now I open it in XCode 7.1 and its screen size is small and static, like:
This is UITableview and it has to adjust view to screen accordingly. What can I do to solve this problem?
Just add the various launch screens as mentioned in Image.xcassets
Right Click to add a new iOS launch image set
And then add the respective launch images
you need to only drag and drop one image default-568h#2x.png
Steps:
after download this image please rename as:"Default-568h#2x.png"
Download image > Drag and drop in Your Project > project Clean and Build > Run
If your table view is Visible but not fully, then You have set constarint for your tableView.
Thanks...
You need to add a splash screen with the right size, that is a splash screen with these dimensions:
Width: 640px
Height: 1136px.
This will automatically adjust the view, as it is building for the old 3.5 inch screens (960px * 640px) found on the pre-iphone 5 devices.
You should also add splash screens for every other supported screen sizes, namely
3.5inches (iPhone 4s and lower)
4inches (iPhone 5, 5c and 5s)
4.7inches (iPhone 6)
5.5inches (iPhone 6 plus)

Adding a Launch Screen changes the display of my whole app

I tried adding a launch screen to my app. I tried the simplest : just add a new file of type Launch screen to my project (and do nothing more). But this seems to change the resolution of my whole application. Here are sample screens of the same controller of my application with and without the Launch Screen :
without the launch screen :
with the launch screen :
Strangely, once I have used the Launch Screen once, I need to quit and re-launch the simulator to re-obtain the original resolution.
What should I do and which resolution is the correct one to work with ? Does it have something to do with retina ?
I can copy-paste the code generated in the LaunchScreen.xib if needed.
From Apple's documentation:
You use a launch XIB or storyboard file to indicate that your app runs
on iPhone 6 Plus or iPhone 6.
By adding a launch screen you activated native support for iPhone 6 and iPhone 6 Plus. That means that your app is no longer scaled up to adapt the larger screens of the iPhone 6 and 6 Plus, but uses the full resolution of those larger screens (which IMHO is a good thing that you should do).

xcode only running 3.5 inch screen [duplicate]

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

not using fullscreen iOS App Xcode 6.0 iphone5s

I have a simple out of box app that doesn't use the entire screen when I deploy it on a iphone5s. By default it creates a LaunchScreen.xib. I have not edited this file on purpose.
Black Bars top and bottom
Other answers suggest to add a Default-568h#2x.png launch image, but I am not using a launch image, and I am not sure where to add these. I see a place for this in the Images.xcassets by clicking the + icon and selecting New Launch Image.
Do I need to add a New Launch Image to Images.xcassets? If so what is the point of having a LaunchScreen.xib?
Thanks!
To get the app to display full screen:
As suggested here (https://stackoverflow.com/a/15328339/4347877), you must include a Default-568h#2x.png launch image (for iOS 7 or earlier). Or if your deployment target is iOS 8 or higher, you have the option of using LaunchScreen.xib.
Why Use LaunchScreen.xib?
For iOS 7 and earlier, app developers had to provide separate launch images for all screen sizes, resolutions and orientations their app supported. For universal apps, up to seven images were required: retina and non-retina versions for 3.5-inch iPhones in portrait and for iPads in portrait and landscape; and another retina image for 4-inch iPhones (the iPhone requires no landscape version because apps are always launched from the portrait-only Home screen).
Creating these images is a nuisance. Xcode 6 comes to the rescue by allowing you to specify a storyboard whose initial view controller will then be used as the app’s launch screen.
If you want to add a launch image instead of using LaunchScreen.xib:
Click on your Images.xcassets folder, right-click in the left pane, and select "New Launch Image." Once you have the correct launch image sizes for all devices you would like to support, drag each image to its respective slot (e.g. "Retina HD 5.5" or "iPhone Portrait 2x"). Before Xcode 6 introduced LaunchScreen.xib I used to create my launch image size here: http://www.appiconsizes.com.
Okay the solution I found came from this question. The answer from James Nick Sears actually fixes my problem. This is after adding the Launch Images. It should be noted that launch images using the images.xcasset is the prefered way to do this pre iOS 8.0 and the only way to make your app compatible with devices running iOS 7 and earlier.
I suggest using TiCons to create the icons, the mapping took me longer then it should have to figure out. In xcode you can see the expected image size for each device by selecting the empty image box and looking in the attribute inspector window on right.
But the real kicker is clicking the 'use asset catalog' button on the "App Icons and Launch Images" of your apps settings under the General tab. Once you click Migrate you can select your LaunchImages from the selection menu that resides where the button used to be, after "Launch Images Source". Without doing this your app won't work correctly on pre iOS 8 devices.

Launch image for iOS 7 iPhone

all!
I have a problem. I've created launch images for my app. I added them through assets catalog.
Ipad ios 6 and 7 works, but iphone works only for ios 6. Ios 7 on iphone shows only black screen (for all: 3, 3 retina and 4 inch), and then app starts, but launch image don't shows.
Yes, iOS6 and iOS7 require you to insert separate launch images for each… Actually, technically, the 2x iOS7 and 2x iOS6 iPhone launch images can be identical, and the R4 iOS7 and R4 iOS7 launch images can likewise be identical, but they are associated separately in the images.xcassets folder based on version.
To guarantee you have launch images associated with each version, go to Targets > General then go to "Launch Images":
Then select all of your supported devices in the right-hand menu under the 3rd tab (in this screenshot from my particular app, only portrait interface is available for iPhone, but if your app also supports landscape, landscape should show up here too). To find out the "expected size" of each launch image, select its placeholder then scroll down to look for the "expected size" also in the right-hand menu. And finally drag the appropriate images into the appropriate placeholder slots to make sure your app has launch images suitable for each device/interface.
I have faced same problem few days ago and i posted my Answer in this question-
iPhone application developed in X-code 5, not showing icon and launch image while running on iPad
Hope it help you.

Resources