我正在尝试在操作栏上获取ic_drawer图标。我想这就是
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(
this,
mDrawerLayout,
R.drawable.ic_drawer,
R.string.drawer_open,
R.string.drawer_close
) {};我在一个带有Theme.AppCompat.Light.DarkActionBar主题的AppCompatActivity中使用它。它为getActionBar()返回一个null值。即使getSupportActionBar()也会返回一个null值。我该怎么做呢?
发布于 2016-08-27 06:34:45
确保你在res/values/styles.xml中的主题有actionBar。它不能继承NoActionBar主题。
https://stackoverflow.com/questions/39174428
复制相似问题