I m having a hard time with this issue.
My MainWindow.xib
, has a NavigationController
, the view for which is inherited from another xib
.
Now, i push a DialogViewController
from the main view, but i cannot see a back button on the second view's navigation bar.
Is there anything specific that i need to set for the DialogViewController
when it is being pushed from a UIViewController
.
Thanks and Regards Abhishek
MonoTouch.Dialog, referred to as MT.D for short, is a rapid UI development toolkit that allows developers to build out application screens and navigation using information, rather than the tedium of creating view controllers, tables, etc. As such, it provides a significant simplification of UI development and code reduction.
To use it, right-click on the References node of a Xamarin.iOS project in Visual Studio 2017 or Visual Studio for Mac and add a reference to the MonoTouch.Dialog-1 assembly. Then, add using MonoTouch.Dialog statements in your source code as necessary.
Go back to the navigation graph and add a destination. In the popup menu, you can see that it knows about MyDialog. Select that. Select MyDialog from the list as the new destination… and make sure it’s coming in as a “Dialog” and not a “Fragment” Observant readers might notice a little IDE bug in the screenshot above.
This is the behavior for all of the Elements that are part of MonoTouch.Dialog, but it is not required for user-created elements. A StringElement shows a caption on the left side of a table cell and the string value on the right side of the cell.
The constructor for DialogViewController has a parameter called pushing which you should set to true:
new DialogViewController(rootElement, true); // true will show the back button
Without seeing your code, I'm not sure exactly what's going wrong here. However, from what I know of UINavigationController
, the view controller stack starts empty. When you push the first view controller, it gives the navigation controller a view to display, but it has nothing to go 'back' to, so it does not display a back button. If you push a second view, you may get a back button.
Also, be sure that the Title
property is set on your child view controllers if you want the back button to reflect the view you will be going back to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With