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

NavigationStack is not updated successfully in xamarin forms ios

$
0
0
I have a xamarin forms project and i use custom master detail page. so i have MasterDetailPage and NavigationPageRenderer in xamarin ios and xamarin android project. i want to navigate as follows

var mdp = App.Current.MainPage as MasterDetailPage;
await mdp.Detail.Navigation.PushAsync(new Page1());
await mdp.Detail.Navigation.PushAsync(new Page2());
await mdp.Detail.Navigation.PushAsync(new Page3());
await mdp.Detail.Navigation.PushAsync(new Page4());
await mdp.Detail.Navigation.PushAsync(new Page5());
await mdp.Detail.Navigation.PushAsync(new Page6());

i have a NavigationStack of 6 elements and i want to go Page2 from Page6. So I did the following operations
for (int i = 0; i < 3; i++)
{
mdp.Detail.Navigation.RemovePage(mdp.Detail.Navigation.NavigationStack[mdp.Detail.Navigation.NavigationStack.Count - 2]);
}
await mdp.Detail.Navigation.PopAsync();

i remove pages between Page6 and Page 2 and then i remove last page(Page6) with PopAsync. This worked successfully in android project. But it's not working in ios project. The stack successfully changed in the ios project, but view is not updated successfully. The screen appears as the title of page 6 and white screen. Page2 doesn't appear.

I tried the following
Device.BeginInvokeOnMainThread(async () => await mdp.Detail.Navigation.PopAsync());
and
await mdp.Detail.Navigation.PopAsync(true);

But it's not working.

Who can help me with this problem?

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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