当我导入AppCompatActivity
ActionBarDrawerToggle
工作正常但导入Activity
时出错:
无法找到符号类ActionBarDrawerToggle
//DrawerLayout
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
答案 0 :(得分:0)
您需要在Gradle中添加支持库: (将25.1.0替换为您的sdk版本)
compile' com.android.support:design:25.1.0'