Я добавил цветPrimaryDark на style.xml, но цвет не повлиял на строку состояния android v21.(цветPrimaryDark) цвет строки состояния не работает на android v21?
У меня есть пользовательская панель инструментов, где я не использую действия бара темы в style.xml коде
если какое-либо решение, пожалуйста, помогите мне?
код стиля: -
<style name="AppTheme" parent="AppTheme.Base">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.Base" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="myCustomToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorSecondary">@color/colorAccent</item>
</style>
стиль v21: -
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:colorPrimary">@color/colorPrimary</item>
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:colorAccent">@color/colorAccent</item>
<item name="windowActionBar">true</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
Панель инструментов Код: -
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:elevation="4dp"
android:background="@color/colorPrimary"
android:popupTheme="@style/Base.ThemeOverlay.AppCompat.Light"
xmlns:android="http://schemas.android.com/apk/res/android" />
Главная Схема Код
<android.support.design.widget.CoordinatorLayout 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"
tools:context=".MainActivity">
<LinearLayout
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<include layout="@layout/custom_toolbar"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button1" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/fab"
android:layout_gravity="right|bottom"
android:src="@mipmap/ic_plus"
android:onClick="fabClick"
android:layout_marginRight="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin_bottom"
fab:borderWidth="0dp"/>
Слава богу. Ты просто спас мне день. * fist bump * – kopikaokao
Я думаю, что случайно удалил это свойство, выполняя некоторые изменения макета. Был поиск последних двух часов для этого решения. – midhunhk