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

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.

Related

What if layout height is longer than device height in xcode?

Please take a look at screen shot from simulator for iphone 8 plus. (01.png) Here is my question: I cant see whole view of my page(i cant see whole part of button5 and button6 because there is no vertical scroll bar) Shouldn't vertical scroll bar appear automatically? If vertical scroll bar appears then i can reach bottom of the page. What should i do? Please give me an advice because i haven't founded any solution yet. You can also take a look at screen shot from xcode main story board to see height of button5 and button 6. (02.png) I mean page background should not move. But I should be able to scrolling up and down through on page. Thanks.
01.png
02.png
Just add image view with background image below all components in the ViewController.
Then add Scroll View with your content on top of that image view.
Don't forget to select clear colour as the background for scroll view and the inner view apart from your buttons.
Follow this tutorial to add Scroll view and content in it directly in storyboard using Interface builder.
https://medium.com/#pradeep_chauhan/how-to-configure-a-uiscrollview-with-auto-layout-in-interface-builder-218dcb4022d7

iPhone X tool bar issue at the bottom

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

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

xcode 6 webview fullscreen

I've almost pulled out all my hairs and I can't seem to find a solution. After searching and watching dozens of tutorials I'm asking here.
I have an iOS universal project in which I have only 1 webview. The whole project is set to landscape. Unfortunately it seems I cannot get this webview run in fullscreen. Whenever I have it running on my iPhone 5 the webview is only visible partially on my phone. The view is a square and centered horizontally and vertically. In landscape mode it reaches top to bottom but on the left and right side I have empty room the view did not reach.
Anyway I think it has something to do with the new storyboard feature stuff in xcode 6, but somehow I don't seem to be able to the make it working as I intend.
As said in the beginning I watched several tutorials but none of em where with only a fullscreen webview. If anyone can give me a push in the right direction I'd be glad.
Thanks in advance.
Edit:
I've added a screenshot of my project:
Hold down 'Ctrl' on keyboard.
Click and hold down click the 'Web View' item in the 'view controller scene' content list on left.
Drag the 'Web View' item up to the 'View' item in the 'view controller scene' content list on left. ( You will see blue line to link the items )
A pop up menu will appear as to how you wish the two items to interact.
There you can select, 'Equals Width', and 'Equals Height'.
Reset all the constraints of the UIWebView and then add the following four constraints:
Trailing space to superview -16
Leading space to superview - 16
Top space to container/superview - 0
Bottom space to container/superview - 0
This will make the UIWebView fullscreen and centered to the UIView.
I finally was able to found a solution to my problem. Thanks for everybody who tried to help me - it seems I was unable to properly describe my problem.
The solution to my problem was found here:
Black bars showing when running app on iOS 7 (4 inch retina display)

Autolayout doesn't work?

So I'm creating my app in storyboard, and i'm using an navigation controller, added an add view, and trying to auto layout stuff there.
But the problem is, i only get blue guided lines when I'm near the corner left and right. So it's basically not looking at my Navigationbar above.. and just ignoring it.
Also, when I'm switching the simulator to a 3.5 inch (I'm making it in 4 inch) the buttons and labels will disappear underneath it. And they are added to Auto layout blue lines?
The blue lines are not AutoLayout, but just lines that guide you when placing your views. Auto Layout only comes in when you start adding constraints. Check out Apple's Autolayout guide:
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html
Control drag from the label to the navigation bar and it will show the below window. The first option is for you to create the constraint from the Navigation Bar bottom.
The Top Layout Guide is a iOS 7 specific feature which marks the bottom line of the navigation bar. The total height of the navigation bar (if present) plus the height of the status bar (if present) equals the toplayoutGuide.length

Resources