//显示侧边栏图标 DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.main_drawer_layout); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); this.setSupportActionBar(toolbar); //将标题隐藏,否则会遮挡小图标 this.getSupportActionBar().setDisplayShowTitleEnabled(false); ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle( this,drawerLayout,toolbar,R.string.open,R.string.close ); drawerLayout.addDrawerListener(actionBarDrawerToggle); actionBarDrawerToggle.syncState();
Android 侧边栏小图标的显示
最新推荐文章于 2025-08-01 02:13:09 发布
