Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

accessing a view in another view controller with FlyoutNavigationController component

$
0
0

Hi There,

I've been trying to use the FlyoutNavigationController component. I have another UIViewController (test) that has a custom UIView (testView). I'd like to load this view when the menu option is touched. I tried to create a new instance of the test class in a bid to access the view but I can't get the syntax correct.

Can someone help me get this working please?

Thanks in advance.

_test = new UIView ();

        var navigation = new FlyoutNavigationController {
            // Create the navigation menu
            NavigationRoot = new RootElement ("Navigation") {
                new Section ("Pages") {
                    new StringElement ("Animals"),
                    new StringElement ("Vegetables"),
                    new StringElement ("Minerals"),
                    new StringElement ("test"),
                }
            },
            // Supply view controllers corresponding to menu items:
            ViewControllers = new [] {
                new UIViewController { View = new UILabel { Text = "Animals (drag right)" } },
                new UIViewController { View = new UILabel { Text = "Vegetables (drag right)" } },
                new UIViewController { View = new UILabel { Text = "Minerals (drag right)" } },
                new UIViewController { View = _test },
                //new UIViewController { View = new test ( UIView = testView }  },
            },
        };
        // Show the navigation view
        //navigation.ToggleMenu ();
        View.AddSubview (navigation.View);

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>