【发布时间】:2015-02-15 20:44:04
【问题描述】:
我有一个问题,我有不同背景颜色(白色或蓝色)的不同活动,而且菜单图标需要是白色或蓝色(与活动背景相反),我找不到正确的更改方法更改活动后,我该怎么做?
【问题讨论】:
我有一个问题,我有不同背景颜色(白色或蓝色)的不同活动,而且菜单图标需要是白色或蓝色(与活动背景相反),我找不到正确的更改方法更改活动后,我该怎么做?
【问题讨论】:
你必须这样做:
mDrawerToggle = new ActionBarDrawerToggle(
this,
mDrawerLayout,
R.drawable.ic_drawer, //<-- This is the icon provided by Google itself
R.string.drawer_open,
R.string.drawer_close
)
这在setUp() 方法中。
别忘了添加这些代码:
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
mDrawerToggle.onConfigurationChanged(newConfig);
}
【讨论】: