I am developing an iPhone app in Xcode 7 which will only open in portrait mode. My question is do I need to provide the launch/splash/default screen also for landscape mode or providing it in the various portrait mode sizes will be sufficient?
I think adding only the portrait ones should work for you. Hope you are using xcassets for managing splash screens. There, You can select the orientations and devices which you want to support. Here is a screenshot.
NOTE: This is from Xcode 6.4. Hope it's something similar in Xcode 7.
Design the LaunchScreen.xib file to look as your desired splash screen. Set proper constraints to your design elements/views. And thats it! It will appear as expected on any orientation.
For example:
If you want your app logo to appear in the center on app launch as splash screen, set your logo in a image view at center, give constraints for horizontally centering, vertically centering and height and width constraints. Now run the app by keeping simulator in various orientations and your launch screen will appear same in all orientations.
Related
I have some troubles with the LaunchScreen.storyboard.
My app is a Universal App, default orientation is portrait but landscape is also allowed.
My LaunchScreen is very simple.
A UILabel with 2 constraints :
Align leading to Safe Area (with constant = 30)
Top space to Safe Area (with constant = 30)
When I check my LaunchScreen inside XCode with simulated traits (iPhone XR, iPad, Landscape, Portrait…) everything looks fine.
When I launch the app in portrait orientation everything looks fine.
Then I turn the simulator (or real device) to landscape and re-run the app.
This time the UILabel doesn't respect it's constraints. The label is touching the black notch and the top space seems twice the defined size.
Do you have the same problem ? How can I fix it ?
Apple describes this in their documentation as follows:
At launch time, apps should always set up their interface in a portrait orientation. After the application(_:didFinishLaunchingWithOptions:) method returns, the app uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.
So I believe the behaviour you're after isn't particularly supported by Apple I'm afraid. As a side note, I'm not entirely sure how they support it on iPads.
Apply constraints to your UILabel as per my below screenshot :-
Also, in your project Target set Deployment Info :-
If you want to change UILabel frame, then ask me.
I am adapting an iPad app (originally built on Objective C/Swift) for the iPhone.
I have removed all things from the UI, the only things left are:
Blue fill - the navigation bar
Red fill - the toolbar
The app appears to have the screen's aspect ratio somehow hard coded for the iPad. I am unable to make the app occupy the full screen using both the interface builder and directly editing the code of the UIViewController.
Doesn't work on iPhone X 11.4 and iPhone 5 9.3, works only on the iPad family.
The issue seems to be outside of the UIViewController or even the UINavigationController.
What project setting may be causing this issue?
iPhone is allowed in Xcode, Targeted Device Family is resolved as 1, 2 for the whole project
Requires full screen is checked for iPhone
The app on various iPhones:
Interface builder - all seems fine there:
Please check for launch images. You need to provide the all sizes of the launch image which are not provided.
You can also add missing sizes from the utilities bar.
I am using Xcode 7.3 and have tried all the ways for setting the launch images,
one way I tried is creating a launch image in assets.xcassets and assigning the appropriate images.
second way I followed the link below,
How do I create launch images for iPhone 6 / 6 Plus Landscape Only Apps?
By following the above link, I am able to set the launch image either portrait or landscape but not both.
Is there any possible way to set a launch image in both portrait and landscape for iPhone devices lesser than iPhone 6 plus?
Are you using storyBoard??..
If you are using story then follow below steps:
1: first add launch screen Click command+n choose LaunchScreen and add.
2: Register the LaunchScreen.open info.plist follow this tutorials [https://useyourloaf.com/blog/using-a-launch-screen-storyboard/][1]
3:drag imageview on the launch screen and choose size class regular width and regular height then add leading, traling top and bottom constraint 0
How can I get the default keyboard to be shorter like the keyboard on the right?
The standard keyboard is the left, how do I get it to have the height of the one on the right?
The left keyboard is not taller than the right keyboard— they are the same height, in points. The difference is in the scale of the screen; i.e. the pixels are smaller on the right. Assuming that these are the same device, the difference is caused by one of two things:
The app on the left is not updated to support the higher resolution screens of the iPhone 6 and 6+. To remedy this, you can either specify a .xib as your "Launch Screen File" in the target's General settings, or add a launch image for iPhone 6 and 6+ to your asset catalog.
The app on the left is running on a device which is in "Zoomed" view mode. To change this, follow this path in your Settings app: General > Display & Brightness > View.
Edit: A good tip for recognizing such resolution differences (on an iPhone 6 or 6+) is to watch the clock as an app launches. If it gets bigger, then your device is set to the "Standard" view mode, and the application has not been updated to support iPhone 6/6+ resolutions. If the clock stays the same size, then either the app has been updated to support iPhone 6, or the device is in the "Zoomed" view mode (or both).
You cannot control the height of the keyboard. The keyboard on the left is looks taller because this app hasn't been updated for iPhone 6/6+ screens, so the keyboard and everything else in the app has been stretched.
See this question for how to support the new 6 screen sizes.
I have created view using autolayout it works fine in all iPhone devices but it left some blank space at left, right, top and bottom on iPad.I tried to make another xib specially for iPad which is 768*1024 but still facing same problem.
here is the screenshot of iPad output.
The problem is that you forgot to make this a universal app. So it is running on the iPad in emulation mode as an iPhone app in a reduced frame.