gpt4 book ai didi

android - 样式被忽略, Lollipop 中的一切都是灰色的

转载 作者:太空宇宙 更新时间:2023-11-03 10:19:24 25 4
gpt4 key购买 nike

我正在尝试更改应用程序的样式,但一切都是灰色的。有什么问题?

我正在使用安卓工作室。这个项目最初是在eclipse上。我没有在 Android Studio 上使用 Lollipop 构建它

<application
android:name=".MainApplication"
tools:replace="android:icon,android:theme"
android:label="@string/app_name"
android:logo="@drawable/ic_logo"
android:theme="@style/Theme.Materialred" >

styles_materialred.xml:

<resources>

<style name="Theme.Materialred" parent="@style/Theme.AppCompat.Light">
<item name="actionBarItemBackground">@drawable/selectable_background_materialred</item>
<item name="popupMenuStyle">@style/PopupMenu.Materialred</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Materialred</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Materialred</item>
<item name="actionDropDownStyle">@style/DropDownNav.Materialred</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Materialred</item>
<item name="actionModeBackground">@drawable/cab_background_top_materialred</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_materialred</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Materialred</item>


</style>

<style name="ActionBar.Solid.Materialred" parent="@style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">@drawable/ab_solid_materialred</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_materialred</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_materialred</item>
<item name="progressBarStyle">@style/ProgressBar.Materialred</item>
</style>

<style name="ActionBar.Transparent.Materialred" parent="@style/Widget.AppCompat.Light.ActionBar">
<item name="background">@drawable/ab_transparent_materialred</item>
<item name="progressBarStyle">@style/ProgressBar.Materialred</item>
</style>

<style name="PopupMenu.Materialred" parent="@style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_materialred</item>
</style>

<style name="DropDownListView.Materialred" parent="@style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_materialred</item>
</style>

<style name="ActionBarTabStyle.Materialred" parent="@style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_materialred</item>
</style>

<style name="DropDownNav.Materialred" parent="@style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_materialred</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_materialred</item>
<item name="android:dropDownSelector">@drawable/selectable_background_materialred</item>
</style>

<style name="ProgressBar.Materialred" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_materialred</item>
</style>

<style name="ActionButton.CloseMode.Materialred" parent="@style/Widget.AppCompat.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_materialred</item>
</style>

<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Materialred.Widget" parent="@style/Theme.AppCompat">
<item name="popupMenuStyle">@style/PopupMenu.Materialred</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Materialred</item>
</style>

最佳答案

在action bar theme中这样设置颜色。

<item name="colorPrimary">@color/primaryDef</item>

阅读 Chris Banes 的这篇有趣文章 https://chris.banes.me/2014/10/17/appcompat-v21/#migrationfromprevioussetup

关于android - 样式被忽略, Lollipop 中的一切都是灰色的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26959535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com