我正在尝试在Android设计库中使用新的TabLayout创建仅带图标的应用栏.
像这样:

如何使用新的TabLayout Android设计库来完成它.
有一个简单的解决方案,或者我必须只使用setCustomView.我试图避免使用它.因为我没有得到像上图这样的图标的色调颜色.
我试着像这样写:
tabLayout.addTab(tabLayout.newTab().setIcon(R.drawable.ic_dashboard))
Run Code Online (Sandbox Code Playgroud)
但是当我选择标签时,图标仍然保持相同的颜色
我的应用程序使用ActionBarActivity和DrawerLayout等.我想将ActionBarDrawerToggle图标更改为自定义可绘制.
在我的代码中,我使用android.support.v7.widget.Toolbar作为SupportActionBar
这是我的代码:
toolbar.setNavigationIcon(R.drawable.lifeline_shield);
setSupportActionBar(toolbar);
ActionBar actionbar = getSupportActionBar();
actionbar.setDisplayHomeAsUpEnabled(true);
actionbar.setDisplayShowTitleEnabled(false);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.somestring1, R.string.somestring2) ....
Run Code Online (Sandbox Code Playgroud)
但我仍然看到汉堡图标,所以我有自己的图标打开抽屉.我怎么解决这个问题?不使用弃用的api
android android-icons android-actionbar android-navigation android-toolbar