This is a migrated thread and some comments may be shown as answers.

Presenting New View Controller

5 Answers 61 Views
SideDrawer
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Trevor
Top achievements
Rank 1
Trevor asked on 13 Mar 2017, 03:50 PM

Hi,

I successfully implemented SideDrawer and customized it to my liking. When I present a ViewController from my Home ViewController, which defined the SideDrawer, it replaces the current view with the drawer and everything, which is an expected behavior with PresentViewController. What is the proper protocol to preserve the SideDrawer throughout the app? Or presenting a view controller in such a way that this does not happen?

Thanks

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 14 Mar 2017, 11:46 AM
Hello,

Thanks for writing. You are probably referring to using a UINavigationController with a SideDrawer?: 

http://docs.telerik.com/devtools/ios/sidedrawer/sidedrawer-with-uinavigationcontroller


Regards,
Deyan
Telerik by Progress
Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
0
Trevor
Top achievements
Rank 1
answered on 15 Mar 2017, 03:14 AM

Hi,

Thanks for the response, I saw that, but I am just trying to present a new view controller depending on which menu item was tapped, from the DidSelectItem. If I do PresentViewController, the view controller appears, but the menu is not retained anymore. How do I solve this and retain the menu in the new view?

0
Deyan
Telerik team
answered on 16 Mar 2017, 09:37 AM
Hi Trevor,

Thanks for writing back.

This should be the solution to your case. By using a root UINavigationController which defines a SideDrawer as described in the article I've shared. In this way you will define the Menu contents once and reuse them thanks to the fact that your root view controller defines a SideDrawer.

Does this not help?

Regards,
Deyan
Telerik by Progress
Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
0
Trevor
Top achievements
Rank 1
answered on 17 Mar 2017, 07:32 PM

Hi,

So the documentation you linked doesn't define a UINavigationController in it. So I assume I do something like:

1.SideDrawerGettingStarted main = new SideDrawerGettingStarted ();
2.UINavigationCongtoller navigationController = new UINavigationController(main);
3.TKSideDrawerController sideDrawerController = new TKSideDrawerController (navigationController);
4.this.Window.RootViewController = sideDrawerController;

 

This keeps the side drawer throughout the app, but now my custom UINavigationBar with the menu button gets overridden by the UINavigationControllers, even the example in the page you linked me, the UINavigationBar defined is overridden. So I am still a bit confused. Thanks for all the help so far!

0
Trevor
Top achievements
Rank 1
answered on 17 Mar 2017, 07:45 PM

Figured out there is a method to hide the UINavigationControllers navigation bar:

this.NavigationController.SetNavigationBarHidden(true, false);
Tags
SideDrawer
Asked by
Trevor
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Trevor
Top achievements
Rank 1
Share this question
or