4
我創建的抽屜佈局既有右側菜單也有左側菜單,因爲它工作正常,但當我打開右側菜單時,我需要停止切換抽屜圖標。我很困惑,請幫助。 在此先感謝。抽屜在右側抽屜中切換
switch(item.getItemId()){
case R.id.add_member:
if(chk==0){
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED,Gravity.RIGHT);
chk=1;
if(drawer.isDrawerOpen(Gravity.LEFT))
{
//ActivityCompat.invalidateOptionsMenu(Main.this);
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED,Gravity.RIGHT);
drawer.closeDrawer(Gravity.LEFT);
drawer.openDrawer(Gravity.RIGHT);
sh=1;
}
else{
drawer.openDrawer(Gravity.RIGHT);
sh=1;
}
}
else if(chk==1){
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.RIGHT);
drawer.closeDrawer(Gravity.RIGHT);
chk=0;
}
break;