Я пытаюсь реализовать панель инструментов ActionBar Material, используя панель инструментов. Пока я создал рабочий стиль ActionBar, но не могу изменить его цвет иконок. Я уже установилПанель инструментов Android для дизайна материалов
Theme.AppCompat.Light.NoActionBar
в style.xml и
android:theme="@style/ThemeOverlay.AppCompat.Dark"
в качестве темы на панели инструментов.
Есть ли способ изменить цвет текста и черные значки на белые?
Источники приведены ниже,
Панель инструментов:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark" >
</android.support.v7.widget.Toolbar>
AppTheme:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/ColorPrimary</item>
<item name="colorPrimaryDark">@color/ColorPrimaryDark</item>
</style>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.materialactionabar.MainActivity" >
<include layout="@layout/toolbar" />
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/navigation_drawer"
android:name="com.example.materialactionabar.NavigationDrawerFragment"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
Благодаря @Ranjith, Понял работает должным образом. У меня есть маленький вопрос, почему нам нужно добавить другой стиль к главной теме? Я имею в виду, что он должен работать без добавления нового стиля. –