[英]Remove the navigation drawer icon and use the app icon to open
I want to remove the small navigation drawer icon and open the left panel on actionbar icon click. 我要删除小的导航抽屉图标,然后在操作栏图标单击上打开左侧面板。 How can I do this?
我怎样才能做到这一点?
Actually I'm creating an Actionbar like Pinterest's 实际上,我正在创建一个像Pinterest一样的Actionbar
If you want to get rid of the DrawerLayout
indicator don't use the ActionBarDrawerToggle
. 如果您想摆脱
DrawerLayout
指标,请不要使用ActionBarDrawerToggle
。 To toggle the DrawerLayout
when you select the ActionBar
home affordance call DrawerLayout.openDrawer
and DrawerLayout.closeDrawer
depending on the current state. 要在选择
ActionBar
家庭提供DrawerLayout
时切换DrawerLayout.openDrawer
, DrawerLayout.closeDrawer
根据当前状态调用DrawerLayout.openDrawer
和DrawerLayout.closeDrawer
。
switch (item.getItemId()) {
case android.R.id.home:
if (mDrawerLayout.isDrawerVisible(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
} else {
mDrawerLayout.openDrawer(GravityCompat.START);
}
return true;
default:
return super.onOptionsItemSelected(item);
}
Also, from what I can tell Pinterest doesn't use a DrawerLayout
. 另外,据我所知,Pinterest不使用
DrawerLayout
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.