Since I updated to Xcode 9.2, the tab bar isn't displayed anymore in one of my child views and I'm struggling to get it back.
I did everything using the storyboard.
Here is a screenshot of it:
As you can see, the same segue is used in both views but the result is not the same...
I ended up using a small workaround. Maybe it is the right way to do it and my first implementation was wrong.
So instead of embedding the tab bar controller in a nav bar controller I ended up putting each tab in a nav bar controller.
Like this:
screenshot
And now everything is working correctly.
Related
I'm rewriting an Obj-C project using Swift 4 / Xcode 9.2
I have a large storyboard that I am breaking down into multiple storyboards. I did this previously without any issues. If I refactored a few views to their own storyboard then the views took the navigation item with them. now they disappear...
[
My questions are ...
Is this an Xcode bug? or a new feature?
Obviously you can work around this as I have shown in the pictures but is there a way to stop the vanishing from happening?
This is the way it's always been. In your storyboard, if a view controller is not a child of a navigation controller via root view controller or push segues, then by default no navigation bar is shown in the storyboard. You can force it on, though, by going to the Simulated Metrics section of the Attributes Inspector tab and selecting one of the navigation bar options for "Top Bar".
Your view controller is no longer a child of a navigation controller, so it no longer automatically has a navigation item. If you need it to have a navigation item, drag a Navigation Item from the Object Library onto it. You will then be able to give the navigation item a title, and drag buttons and so forth onto the navigation item.
I’m working on a project in Xcode 9.1 and a very strange problem occurs with my Table View Controller.
I need to have a table view with static cells and Xcode tells me that I can achieve this only with a TableViewController (doesn’t work with a TableView in a ViewController. Gives me errors).
I’ve embedded my TableViewController inside a Navigation Controller, but when I run the project, the table View scrolls and it’s visible under the status bar (on every iPhone, from X to SE).
I wanted to make the status bar opaque but didn’t find a way to do it.
Am I doing something wrong?
My steps are:
1) Dragged a TableViewController on the storyboard
2) Embed the TableViewController into a Navigation Bar (I’ve tried also to drag the Navigation Bar directly and it comes already connected to a TableViewController).
3) Set the Cells to Static
4) Run on device or simulator.
Screenshot of my problem
Solved it!
The problem was the code I wrote to hide the navigation bar hairline (the 1px line under the bar).
Commenting the code make everything work fine.
To fix your issue I think your Navigation Bar is set to hidden.
1. In your storyboard click on the navigationBar in the navigation controller.
2. Then look for the attributes section "Drawing"
3. Check to see if hidden is true.
4. If it is uncheck it.
My setup has it set to false as default.
to hide navigation you need to write below code in viewDidLoad
self.navigationController?.isNavigationBarHidden = true
I don't know why but my navigation bar is missing from my ios simulation.
Anybody know where might be the problem?
Yes I have "Shows Navigation bar" and I don't have any warnings.
I wanted to try "Update frames" but I don't have this option available.
I am using Xcode 7.3 and Swift.
Thank you
You can solve by embedding a navigation controller:
As other people have said in the comments without showing some code or screenshot of IB it's hard to find out where the problem is... But here's some things to checkout.
Are you sure your view controller is embedded in a UINavigationController?
If you are using Storyboards you should have something like this:
In code instead you might have set the window.rootViewController property in the AppDelegate to the content view controller rather than the navigation controller which is supposed to contain it.
Its depend how to embedding navigation controller but you can try to embedding navigation controller following below way and than run application and check in simulator : Go to Editor in xcode -> Embed in -> Navigation Controller.
I had the same problem: the navigation bar was showing on the root view in Storyboard, but when running the Simulator - there was no navigation bar at the top of the views. This solved it:
Navigation Controller > Navigation Bar > UNCHECK Translucent (it is checked by default). This did two things:
My Navigation Bar shows on all subsequent views.
The topmost subview on subsequent views is now at Y=0, and not Y=64.
There are two possibilities.
1) May be you didn't Embeded navigationcontroller before your viewcontroller. so, add Navigation controller with go to
Editor -> Embededin -> Navigation controller.
2) If you have add navigation controller but May be you have set NONE as topbar of Viewcontroller.
I'm not sure what happened, but while editing the title of my Navigation bar, the Navigation bar suddenly became deformed like this:
On the device, the navigation bar seems to be twice the regular height:
The navigation bar is generated by connecting a navigation controller via the storyboard. It was working fine for weeks until now. I tried the following in an attempt to remedy the problem:
Clean + Build
Restart Xcode
Restart my macbook
Turning off and on my size classes
Deleting the Navigation controller and dragging a new one back on screen.
Anyone know how to solve this problem?
Sounds more like the view controller embedded in the navigation controller is whats corrupt.
Did you try re-creating the view controller as well?
I am new to iOS development and have not tried this programmatically yet. I would prefer to get this working in a storyboard.
I'm following this somewhat outdated tutorial from XCode 4.5 in XCode 6.1 to create a series of views connected by one navigation controller.
http://youtu.be/rgd6mCuzlEc
Once I create the second view controller, I am unable to double click the navigation bar to change the name and I am unable to add a bar button to it.
I have a Segue going from bar button "Item" from view 1 to 2. Notice in the "View Controller Scene" there is no navigation item. If I add any elements to the view controller they fall under "View" and not under "View Controller", unlike view controller 1 where it falls under "one".
Is this a limitation on XCode? Am I using the wrong Segue (Show)? Is there a hidden setting or customization I'm missing?
I actually have this working for 2 view controllers and failing the 3rd in a separate project but I don't know what I did to do that so I'm pretty sure it's possible I just cannot reproduce..
EDIT: Workaround Instead of the new adaptive SHOW segue, use the deprecated PUSH segue, add the bar button items, then change back to the adaptive SHOW segue.
Try adding a Navigation Item to the controller and it should work properly