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

Closing a screen?

$
0
0

Hi

I have the following code that puts 2 buttons on one of them blue bars at the top of the screen (navigationbar???). I can open a new screen no problems but I can not for the life of me work out how to close one.

I want the button with the title 'ggg' to just close the current screen and go back to the one previously.

here is the code I'm using

`UIBarButtonItem btnClose = new UIBarButtonItem(); btn.Title = "ggg";

        this.NavigationItem.LeftBarButtonItem = btnClose;

        btnClose.Clicked += (sender, args) =>
            {
                // close the screen here !!!
            };

        this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Action, (sender, args) =>
        {
            this.window = new UIWindow(UIScreen.MainScreen.Bounds);

            var rootNavigationController = new UINavigationController();
            tempScreen homeScreen = new tempScreen();
            rootNavigationController.PushViewController(homeScreen, true);
            this.window.RootViewController = rootNavigationController;
            this.window.MakeKeyAndVisible(); 
        })
        , true);`

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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