我正在玩Jake Wharton 的包含 NavigationDrawer的u2020示例应用程序的u2020-mortar模式。我想要做的是让 NavidationDrawer 在打开时通过操作栏移动内容。我这样做是这样的:
coreView = (CoreView) getLayoutInflater().inflate(R.layout.core, null); //extends DrawerLayout
ViewGroup decor = (ViewGroup) getWindow().getDecorView();
ViewGroup decorChild = (ViewGroup) decor.getChildAt(0);
decor.removeView(decorChild);
decor.addView(coreView);
coreView.getContentFrame().addView(decorChild);
我从SlidingMenu lib借来的这项技术。
但结果是没有操作栏,所有视图都在通知区域后面,就像屏幕截图一样:
所以问题是为什么会这样,我做错了什么以及如何达到目标?