Swift - Navigation Bars [duplicate] - ios

This question already has answers here:
ios 11 custom navbar goes under status bar
(5 answers)
Closed 5 years ago.
I am having trouble making it so that the navigation bar will have an optimised display for both the iPhone X and all other iPhones and iPads.
I have read on the apple developer documentation that the navigation bar is meant to adapt so that the title is not hidden by the sensor housing on the iPhone X.
I have therefore tried making a navigation bar as normal on an iPhone 8 on the Interface Builder (and adding height 65 constraints, as well as top, left and right attachment constraints).
When I run in the simulator, the iPhone X shows the navigation bar through the sensor housing, thus meaning the title isn't visible.
Any help on how to get navigation bars working for all iPhones and iPads and the iPhone X at the same time would be much appreciated.
Thanks in advance :)

As of iOS 11 you are supposed to be using the new safe area guides to position your content. Do not assume a bar size as an offset from your view. See the apple documentation on Positioning Content Relative to the Safe Area

Related

screen breaking in iPhone x for higher iOS versions.there is no storyboards design done through code

In my project tabbar(it's like below the navigation bar i have 4 buttons in my tabbar) is going to top after app launches it's happening in iPhone x for higher iOS versions.we are not using storyboards,design done through codeing.check below screenshots.
In the first screenshot u can't see search bar and above tabs[location,search,deals this is the problem.
if u observe second one u can see address bar and above tabs for lowerversions it was working.
This is breaking screen for higher versions above ios11
This is for lower versions design is fine

App not occupying complete screen in iphone X simulator in Xcode 9 [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.
With the release of Xcode 9, we are able to test UI of our app on iPhone X simulator. When I ran my app on iPhone X simulator, it does not occupy complete screen. There is space left on the top and bottom of the Apps View.
Can anyone please tell how to remove that space, I am already using auto layouts in my app. I am attaching the screenshot of my app.
You need to add Splash screen/Launch Image for iPhone X in xcode 9.
iPhone X launch image's dimensions are 1125 x 2436
It is because of the new feature Safe Area of Xcode 9 to handle user interface design for iPhone-X.
It is required to handle user interface design for iPhone-X. Here is basic guideline for How to design user interface for iPhone-X using Safe Area Layout
Here is the developer guidelines of apple IPhone-X Development
You can solve this by 2 ways
1. Uncheck use safe area support
2. If you are using Autolayout adjust your toplayout constraint value as that achive FullScreen

iOS Application screen sizes have black bars on some screens at top and bottom [duplicate]

This question already has answers here:
iOS 9 Xcode 7 - Application appears with black bars on top and bottom
(17 answers)
Closed 6 years ago.
Recently I've upgraded to XCode 7 and have been having some trouble with screen sizes on my application, mainly black bars the appear at the top and bottom of the screen.
I've read through similar threads and implemented the fixes suggested which was adding a launch screen image and that worked for my iPhone 6's size but when I try running the simulator for the iPhone 6+ the black bars at the top and bottom of the screen are still there.
Also the screen wont resize for smaller versions either and parts get cut off or go off screen.
Any help would be greatly appreciated, thanks!
I ran into this problem last week updating an old app. Adding a launch screen image won't entirely solve it. Instead, you need to create a new launch screen.storyboard (File -> New -> File -> User Interface Tab (on the left) -> Launch Screen
Then in your project settings, set your launch screen file to the .storyboard file you just created. This should automatically fix the black bars.

iOS 7 status bar supposed to overlap content?

I have recently updated my XCode to 5.0.1 as to be able to test my application on iOS 7.
Everything seems to be working as expected, but for some reason the status bar is overlapping the screen's content.
Now, I am still able to see the overlapped content as the status bar in iOS 7 is translucent, but it looks very weird.
I could always move my content down a bit to compensate for the height taken up by the status bar, but how would that look in iOS 6??
Is this intentional on Apple's part? Is there a standard procedure we as developers are supposed to follow to get this looking how it should?
Also, should I just add 20 pixels (or whatever the height of the status bar is) to the top of my view and just forget about iOS 6?
I have decided to just set my Top Space to: Superview to 20 (the height of the status bar) for all my parent views.
Looks good on iOS 7 but there is a 20pixel gap on iOS 6, and given the fact that 80% of our iPhone users have already updated their OSes to 7, I think it's safe to just assume that eventually everyone will be using iOS 7 and support for iOS 6 will no longer be needed.
I'm not gonna break my head anymore over this.
Thanks anyways!

iOS 7 Status Bar mixing in with view [duplicate]

This question already has answers here:
Status bar and navigation bar appear over my view's bounds in iOS 7
(20 answers)
Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?
(6 answers)
Closed 9 years ago.
I am creating an application that will work in both iOS 6 and iOS 7. I have a view with a header image at the top. In iOS6 it works fine as it doesn't cover or interfere with the status bar at the top of the screen. However, in iOS 7 the view mixes in with the status bar and it looks terrible. I would need to know how to rectify this without it affecting iOS 6?
Select your view containing elements in Interface Builder.
Select Size Inspector tab from right menu.
in iOS 6/7 Deltas, give -20 in Delta-Y and 20 in Delta-height.
NOTE: not applicable using Auto-layouts.

Resources