我正在为我的应用程序使用自定义操作栏,以下是代码:
actionBar.setDisplayShowCustomEnabled(true);
getSupportActionBar().setDisplayShowCustomEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setHomeButtonEnabled(false);
actionBar.setIcon(null);
actionBar.setCustomView(mCustomView);
Toolbar parent =(Toolbar) mCustomView.getParent();
parent.setContentInsetsAbsolute(0, 0);
这是代码的结果,我在顶部和底部留有边距:
如何去掉这个边距?
我正在使用Theme.AppCompat.Light作为我的应用程序模板。