When opening up a project today, there is some weird behavior in XCode. Things have disappeared in the storyboard view like the NavigationBar in viewController, the buttons associated with it, etc. I can see in the Scene list that they still exist. Is there any way to have these show up again?
You probably need to add a navigation controller to your storyboard and make your view controller the root. You cannot simply set the top bar in simulated metrics in storyboard to navigation bar.
Related
When I was trying to modify the navigation bar's title in one of my view controllers, Xcode seems to render the bar incorrectly, like below:
As you can see, the title and the rightmost button I added earlier are compressed in a strange manner. I tried to re-open Xcode, but it doesn't work.
Does anyone know how to fix this?
I have some working navigation between ViewControllers, using a UINavigationController.
But if you look in the image, you'll see my ViewControllers in InterfaceBuilder have an item called "Navigation Item" which showed up when connecting it to the UINavigationController.
However, the TutorialViewController doesn't have this. How do I get it to show up? I tried copying the Navigation Item from one controller and pasting it into another, but that didn't work.
The really weird thing is that if I use the button on the front page to go to the Tutorial page, the navigation works, shows a back button and everything.
Just drag & drop a Navigation Item from the object library onto your ViewController in InterfaceBuilder
I am going round in circles trying to get a custom view to scroll correctly.
To simplify this.
I create a new OSX cocoa application.
Go to the xib file, select the window. drag a custom view, then drag a few buttons into it.
Run the program, you have a button in the screen.
Now go back the custom view, select editor -> embed in -> Scroll view
Everything looks fine, and suggests you will have two buttons with scroll bars in the custom view.
Run the program, the custom view shows with scroll bars, but the button do not show.
What am I doing wrong?
Following your instructions I have created and changed the project. No problem.
Run in IB your "app", CMD R. The user interface itself can be checked in this way.
If problem remains
Check the layer position->Click on the custom View
Is it possible to Layout->Send to back? If yes, then your button-scrollview is not embedded.
Unembed the button, view and repeat the process, by checking in IB if now the interface shows appears correctly.
I'm developing a storyboard app with UITabBarController.
I want a UINavigationBar on one of the tab ViewControllers. I set the property Black NavigatonBar in ViewController property, and also drag navigationItem to this view.
NavigationBar is not visible in the viewVontroller when I run the app
It sounds like you're changing the pop up in the simulated metrics inspector. That inspector allows you to tell Xcode about things that will exist in your app that don't exist in the storyboard.
It sounds like you want to add a navigation controller into the storyboard to wrap one of the view controllers in your tab controller. You can do that in the editor menu by choosing the "Embed in" menu, and then choosing "Navigation Controller".
Choosing that item will insert a new navigation controller, make the selected view controller the root of the navigation controller, and re-route any segues that used to point at the selected to controller to point at the navigation controller instead.
xcode 4.6
using Storyboards
When I drag a Bar Button Item to the navigation bar at the top of one of the UITableViewControllers that are children of the UITabBarController xcode creates a new navigation bar at the bottom of the page instead of adding the button where I dropped it. I would be ok with this, but when I run the app the bottom navigation bar never shows up, so my button is never displayed.
If you need to visualize the app, picture the following: Root controller displays a list of accounts. When an account is clicked a tab controller lists tabs for opportunities and contacts. I need the ability to add opportunities and contacts from the relevant tab
Any help is greatly appreciated.
EDIT
I am not sure if this is the correct solution or not. I have embedded the uitableviewcontrollers in navigation controllers, which appears to have fixed the problem.
Follow-up question - Is this the correct way to handle this situation?
Yes, that is the correct way to handle this situation.
You should embed the view controller inside a navigation controller by clicking the view controller in your storyboard and using the Xcode menu "Editor" > "Embed In" > "Navigation Controller".