iPhone X tool bar issue at the bottom - ios

My app works well on all device except for iPhone X.
On iPhone X the tool bar on the bottom is shown like as shown in image
But I want to show it like shown in second image
But when ever I shift the tool bar up so that it will show properly on iPhone X then it also move upwards in other devices.
How should I solve this problem.

Actually the bottom bar of my view is inside another view thats why it is not extending accordingly.
So simply putting the bottom bar outside, on the main view and adjusting the constraint simply resolve my issue.

In my case My toolbar's bottom constraint was attached to superview's bottom. Changing it to Safe Area bottom resolved the issue for me

Related

iphone X navigation display issue

I have two items on the navigation bar. named More on the left and Search on the right. When i run the app on the simulator, two items are moved to 2 top ears of the phone. see below for more detail. this is not happening on none iphone X
This is happening because your constraints are set to superview, not safe area (or not using safe area at all).
In your Storyboard, click on your ViewController, click on your view then go to the Size inspector.
There, make sure that your safe area layout guide is enabled. Then, just bind your view's edges to safe area instead of superview

bar button is not showing on the navigation bar at run time

I am following this tutorial, and as shown in image-1 below, I added the "Add" bar button, but when I run the simulator it does not show up as shown in image-2.
please let me know why the "Add" button is not showing and how to fix it.
image-1:
image-2:
Two possible scenario :
Scene 1 :
Looks like you are using iPhone 6s Plus simulator and 100% zoomed. So I could see horizontal and vertical scroll both. I believe the Plus button is still there its just that u have to scroll to see it. Even the title Players is not in center :)
Use Command + 3 to zoom out the simulator and see the O/P without scroll :D
Scene 2:
If you have added Navigation bar manually make sure you add top, leading and trailing constraint to Navigation Bar. The Nav bar you added is bigger than iPhone 6 plus size and because there is no auto layout constraint added it might have extended beyond the screen.

Double Navigation Bar in View

I have a problem with a "double" navigation bar in a screen of my iPhone app.
Starting position:
Xcode 8, Swift
I have a TableView with static lines that is embedded in a navigation controller. From the first cell I then call a screen (Segue Show Detail), which is very complex (labels, text boxes, buttons, etc.). When I execute the "Reset to suggested constraints" function on the screen, the screen is supplied with "generated" constraints. This is still clear. When I run my app in the simulator (iPhone 6) or my own iPhone 6, I see on the above screen a status bar, then my right navigation bar (Back button, title) and below an "empty" 2.Navigation bar. This decreases the screen down and is no longer fully visible. If I delete the constraints for the screen with the "Clear Constraints" function, the screen in the simulator (i6) looks good as I develop in the storyboard for the iPhone 7. But when I connect my own iPhone 6 and test, the screen does not fit completely to my iPhone, because right and down is something truncated.
I suspect the error in the "generated" constraints.
Now my question:
How can I check the generated Contraints (well over 100) for errors?
In the Internet and the forum I found nothing, which could help me.
Workaround for me:
The top UI element on the screen is a label across the entire width of the screen. For this label, I set a constraint manually, in addition to the generated constraints
Label.top = Top Layout Guide.bottom + 44,
whose value I then change to the value
Label.top = Top Layout Guide.bottom
This causes the label to slide directly below the status bar in the storyboard. The navigation bar is then no longer visible in the storyboard. This makes the placement of UI-Elements at the bottom of the screen somewhat more difficult because you do not know exactly which space is still available.
The display in the simulator (i6) and on my iPhone 6 looks however through the workaround ok.
For your help I would be very grateful.
Greeting Reinhard

iOS AutoLayout - Button moves when app is launched

I will try to describe this issue--never seen this behavior before.
I have a button that moves from the right of the app's screen to the middle when the app launches on the simulator or actual device. I want it to always be in the middle (where it moves to).
Basically, it moves from one position on the parent view to another position (I want it to ALWAYS be in the position defined by the constraints)
How do I accomplish this?
Here are images to show the behavior and the constraints:
Button is on the right, higher up; then fades out
Button fades in to the bottom, centered position (correct per constraints listed below)
Button constraints:
Button.centerX = centerX (center the button to the container's horizontal center)
Bottom Layout Guilde.top = Button.bottom + 112 (anchor the button to the bottom of the app regardless of screen size or orientation).
Just add two constraints BottomSpace and CentreX as below. (And if required explicit height and width)
1.Also provide button.left.
Or
2. Use constraints show in image.
OK, I fixed the issue. Somehow, the splash screen storyboard got a copy of the button and other views that i had on the main storyboard. Once I deleted the button from the splash screen story board, the button issue stopped.
Apparently the first screen shot was the splash screen, and the second screen shot was the actual app (main storyboard).
Thanks to everyone for trying to help!

UIToolbarPosition set to bottom on resize

I have a UIToolBar at the top of one of my views and the shadowing shows up on the bottom of the tool bar as I'd expect. I know UIToolbarPosition is internally set to UIToolbarPositionTop.
When I rotate my device (iPad), the tool bar grows (using auto sizing in IB) and the UIToolbarPosition changes to UIToolbarPositionBottom which flips the shadow to be at the top of the bar. If I don't have the bar resize, it remains correct, but of course doesn't stretch to match screen width.
So, what gives? What would cause the UIToolbarPosition to flip on me? This is sitting at 0,0 the whole time and only changes width based on rotation.
Extra: I've considered work arounds like using a UINavigationBar. UIAppearance is probably a no go because I do have a toolbar at the bottom too and I do want my "top" different than my "bottom"
I eventually solved this using the UIBarPositioning protocol on UIToolBarand setting the barPosition = UIBarPositionTop

Resources