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

Flicker/delay happens while navigating to some other page on click of menu item in MasterDetail Page

$
0
0

Hi all,
I am using a Master detail Page in my xamarin forms project and its having a few items in slide out menu which opens some other page on their click event.
I am using the same approch which is given in xmarin site like :

public void PopulateSildeOutMenu()
{
string path = Helpers.Settings.getSettings ("ProfileImage");
if (String.IsNullOrEmpty (path)) {
path = "default.jpg";
}

        cand_dashboard_slideOutMenu_profileImage.FileSource = path;

        var slideOutMenuItems1 = new List<SlideOutMenuItem> ();
        slideOutMenuItems1.Add (new SlideOutMenuItem {
            Title = "Dashboard",
            IconSource = "dashboard.png",
            TargetType = typeof(DashboardHome)
        });
        slideOutMenuItems1.Add (new SlideOutMenuItem {
            Title = "Notifications",
            IconSource = "notifications.png",
            TargetType = typeof(DashboardHome)
        });
        slideOutMenuItems1.Add (new SlideOutMenuItem {
            Title = "My Profile",
            IconSource = "my_profile.png",
            TargetType = typeof(Profile)
        });

}

above code is in my slideout page and following in Masterdetail Page :

public partial class MasterDetail : MasterDetailPage
{

    public MasterDetail()
    {
        InitializeComponent ();
        NavigationPage.SetHasNavigationBar (this, false);
        slideOutMenu.ItemList1.ItemSelected += OnItemSelected;

    }


    async void OnItemSelected (object sender, SelectedItemChangedEventArgs e)
    {
        var item = e.SelectedItem as SlideOutMenuItem;
        if (item != null) {

                    Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
                    slideOutMenu.ItemList1.SelectedItem = null;
            IsPresented = false;
        }
    }
}

The above code works fine for me when I am navigating to other page in iOS but, same code creats a flicker/delay in opening next page while using in Android i.e. Page doesn't loads instantly. Any solution for that.. ?
Please suggest something, Thanks.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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