我正在尝试将此工具栏颜色更改为“完全白色”,例如Android Lollipop设置 操作栏颜色,但是在我们看来,这是一个错误或类似的东西,或者可能是一个Android错误!
我的工具栏:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/Theme.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
风格:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
和样式箭头:
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">@android:color/white</item>
</style>
结果:
如您所见,名称是黑色!并且还添加了这些之后,搜索图标会有点黑。(你可以试试 ;) )
但是我需要带有白色动作的完全白色。
如何做到这一点?
我已经尝试了您可以期待的一切!
您可以尝试以下方法:
取自:https : //github.com/sagar-viradiya/android-design-support-lib-demo/blob/master/app/src/main/res/layout/fragment_collapsing_toolbar.xml
只需将其添加到AppBarLayout
:app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
前任的:
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="256dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
对于PopUptheme
:
<android.support.v7.widget.Toolbar
android:id="@+id/Main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/Theme.AppCompat.Light" />
但是我不知道该搜索动作以及为何仍然有点黑。
如果有人知道,请指导我们。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句