Maybe I'm missing something super simple, but I can't seem to get a title to show up at the top of Views contained within a basic tabbed application. I follow these steps...
New Solution, Universal Storyboard, Tabbed Application
Run that and you have two basic Views "First View" and "Second View".
Neither View by default has a title bar, but the default code shows setting a this.Title.
Why don't the title bars show up? How do I get them to show? I've tried several things to get these to show such as...
Setting "Top Bar" in Interface Builder to "Navigation Bar". It then shows in Interface Builder but never shows on runtime.
I've also tried in ViewDidLoad() to set this.TabBarController.Title but that doesn't seem to do anything either.
Thoughts?
The feature you are looking for is called a NavigationBar and can be added manually via IB to your view if it does not have a NavigationController associated with it. If there is a navigation controller then the NavigationBar will show up automatically.
So to answer your question if you want a NavigationBar go to IB and add one from the objects library you should then be able to manipulate the Title on the nav bar to your hearts content.
Related
I have a view controller in one storyboard that I'd like to reuse in another storyboard's Tab Bar Controller. In XCode, I can add a storyboard reference and then ctrl-drag from the Tab Bar Controller to it, and it shows up as another tab, just like a View Controller would in the same storyboard. I'm trying to do this in VS 2017 though and it doesn't seem to work. Or if it does, I'm unsure of how to do it. I tried adding a storyboard reference and ctrl-dragging, just like I do for normal View Controllers. I select "Tab" under "View Relationship" which pops up when I finish dragging, but it never makes the link and never makes the tab.
Is this even something that is valid? And if it is, is it a bug/limitation with VS that I can't do this, and is there a workaround?
Edit:
I managed to get this to work programmatically. Here's what I did in case anyone wants to know. However, I still would like to know the answer to my previous questions.
First, in your desired VC (I'm going to call it TestVC), make sure you add a Tab Bar Item (not a tab bar). Set up the title and image as you would normally. Then, in your Tab Bar Controller's ViewDidLoad method, do something like this:
var storyboard = UIStoryboard.FromName("StoryboardNameTestVCIsIn", null);
var vc = storyboard.InstantiateViewController("TestVC");
var existing = new List<UIViewController>(ViewControllers);
existing.Add(vc);
ViewControllers = existing.ToArray();
Is this even something that is valid? And if it is, is it a bug/limitation with VS that I can't do this, and is there a workaround?
It is not support to add Tab relationship by this way. As you mentioned above, you could only implement that programmatically. Maybe in the near future Xamarin will support it like in Xcode.
Click on the segue , and you can see all the actions you can do.
I'm creating a custom theme for an Odoo online shop. I need to have a main menu, which would be the one that comes by default with the website module, and a secondary menu that I want to display on all pages, somewhere below the main menu.
I created the secondary menu in the backend, this what it looks like :
The "Top Menu" is the default menu, it shows properly in the top right of the website's pages. I just can't figure out how to show the "Navigation" menu in my templates.
Copying this piece of code from the website module anywhere in my templates shows the "Top Menu" :
<t t-foreach="website.menu_id.child_id" t-as="submenu">
<t t-call="website.submenu"/>
</t>
So I guess this "Top Menu" is somehow associated to the website module right ? So do I need to "associate" the "Navigation" menu to my theme ? How would I do that ?
Or did I just do everything wrong ? I'm used to Wordpress' wp_nav_menu function with wich you can simply get a menu by its ID but maybe it's not the way to go with Odoo ? I'm having a hard time finding help on this matter in the doc or in forums.
I've a simple view which is embedded in an UINavigationController. This view contains a segemented control in it's top bar and a ContainerView as subview.
The content for the ContainerView is a UITableViewController with a UISearchBarController.
I've set EdgesForExtendedLayout to none for both controllers.
After first start it looks okey:
After tapping the first time into the search bar - the bar is hidden behind the navigation bar:
After tapping outside a small part of the search bar is visable (grey border):
If I drag down then it looks like that:
After changing the view (push and pop on UINavigationController) it looks like that:
Any ideas to fix this?
I guess you want all your view to scroll, and not only the UITableView.
I'd embed everything in a UIScrollView (segmentedcontrol and tableview), and make sure the tableview doesn't scroll by itself.
This relates to a question I asked a few days ago: iOS: Setting text in nib subview from view in UITabBar/UINavigationController application
I need to put the search bar and buttons on the top right of a navigation controller, this is more than the standard single button that UINavigationController.navigationItem.rightBarButtonItem allows so I am using the initWithCustomView: method of UIBarButtonItem to load a view from a nib file.
In my particular case, i've put the view as a seperate item in the main view file for that form
The problem i've got is load and display sequence and I wanted to know if this was the right approach to this?
It seems that the following happens:
viewDidLoad on my main window gets called
viewDidAppear on my main window gets called and I set up rightBarButtonItem
I then want to populate a text field on that search bar but because the loading of the view for the button item happens in the main thread, I don't know when it's appeared.
Would I be better to create a new class with nib for the search bar and buttons which would then have a viewDidLoad/viewDidAppear and I could then create a delegate function so I could 'deQueue' the text to go into the search bar?
Or, am I missing something really simple?
I would love to know from anyone who knows how we can keep the a widget in mvp static by putting it in the entry point class.Or is it recommended to include the widget in appcontroller.
I have an issue like I want to make my menu bar static throughout my page. For this I follow
I will create a RootPanel
I divide the page into two by adding two panels.I would like to send the mainpanel to the Appcontroller by goTo and change the main panel with respect to the click in the menu bar.
Here i am confused like where should I add my menu bar to handle its events.
Can anyone help me out with this