0
我正在努力设置我的android.widget.Toolbar上的“汉堡包”图标的颜色,也是我在网上找到的大多数答案适用于support/v7工具栏,但我使用的是android.widget.Toolbar。android.widget.Toolbar主页按钮颜色(不支持/ v7/AppCompat工具栏)
这是我的代码如下所示:
Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar);
setActionBar(toolbar);
ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_closed);
drawerLayout.addDrawerListener(drawerToggle);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
drawerToggle.syncState();
我希望能够风格在我styles.xml文件,这可能吗?我正在使用材质主题,这是我当前的styles.xml:
<resources>
<style
name="AppTheme"
parent="@android:style/Theme.Material.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColor">@color/textColor</item>
<item name="iconColor">@color/iconColor</item>
</style>
<style
name="SplashTheme"
parent="AppTheme">
<item name="android:windowBackground">@drawable/splash_screen</item>
</style>
</resources>
感谢您的帮助。
非常感谢你。小问题:混合材质主题和AppCompat主题没有问题吗? –
其实AppCompat是支持那些不支持Material Themes的设备的支持库。所以你可以混合它......他们会工作 –