0
我想優化導航抽屜關閉的速度。在我的導航抽屜中,當我點擊一個項目時,它導航到不同的活動,但導航速度不是很快(與點擊導航抽屜外部時如何關閉的速度相比,它關閉非常平滑)。優化導航抽屜關閉速度 - Xamarin Android
如何在新活動顯示之前使導航抽屜非常平滑地關閉?
這是我結束我的導航欄打開新的活動
private void SetUpDrawerContent(NavigationView navigationView)
{
navigationView.NavigationItemSelected += (object sender, NavigationView.NavigationItemSelectedEventArgs e) =>
{
int id = e.MenuItem.ItemId;
switch (id)
{
case Resource.Id.nav_1:
Intent intent = new Intent(this, typeof(activity1));
this.StartActivity(intent);
GC.Collect();
break;
case Resource.Id.nav_2:
if (user != null)
{
Intent events = new Intent(this, typeof(EventActivity));
this.StartActivity(events);
GC.Collect();
}
else {
Intent loginEvent = new Intent(this, typeof(LoginActivity));
this.StartActivity(loginEvent);
}
break;
}
e.MenuItem.SetChecked(true);
mDrawerLayout.CloseDrawers();
};
}