Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

OnAppearing Event - Called before page is drawn on Android

$
0
0

I have a forms app and I am getting different behavior when I load my tabbed pages into the navigation stack. For some reason the OnAppearing method of one of my content pages gets fired immediately in Android only. Ios it functions as expected and only fires once the page "Appears". My question is how do I ensure my "OnAppearing" method actually fires when the page is drawn or Appears on the screen. I have some logic that refreshes the page and the fact it does not fire when it is initially navigated to is causing problems in Android. Here is my main page xaml when I setup my pages

      public MainPage()
            {
                InitializeComponent();

                Page HomePage, TestPage, UserPage = null;


                HomePage = new NavigationPage(new HomePage())
                {
                    Title = "Home" 
                };
               TestPage = new NavigationPage(new TestPage())
                {
                    Title = "Test"
                };
                UserPage = new NavigationPage(new UserPage())
                {
                    Title = "Users"
                };


            Children.Add(HomePage);
                Children.Add(TestPage);
                Children.Add(UsersPage);



    }

App.xaml.cs

    public App()
            {
                InitializeComponent();

                MainPage = new MainPage();

            }

    }

Viewing all articles
Browse latest Browse all 77050

Trending Articles



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