我正在使用appcompat,我尝试过使用Action Bar Style Generator。我设置了我的颜色等,然后下载了我的拉链。但是,一旦我解压缩,drawables就会重复,例如:
test.9.png 测试2.9.png 测试3.9.png 测试4.9.png
所以我总共有4个相同的drawable。无论如何,我将我的样式xml复制到values文件夹中,将所有png和drawable xml复制到drawable文件夹中。然后我相应地编辑我的清单以设置主题。
然而,当我运行我的应用程序时,主题似乎没有生效。实际上它似乎有一个默认主题的蓝色标签指示器,白色标签文本和黑色标签。
有没有人对此有任何建议,因为我已多次尝试过,我不知道该怎么做......
我的清单中的代码
<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/Theme.Vdstyle">
<uses-library android:name="com.google.android.maps" />
来自生成的样式的代码
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Vdstyle" parent="@style/Theme.AppCompat">
<item name="actionBarItemBackground">@drawable/selectable_background_vdstyle</item>
<item name="popupMenuStyle">@style/PopupMenu.Vdstyle</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Vdstyle</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Vdstyle</item>
<item name="actionDropDownStyle">@style/DropDownNav.Vdstyle</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Vdstyle</item>
<item name="actionModeBackground">@drawable/cab_background_top_vdstyle</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_vdstyle</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Vdstyle</item>
</style>
<style name="ActionBar.Solid.Vdstyle" parent="@style/Widget.AppCompat.ActionBar.Solid">
<item name="background">@drawable/ab_solid_vdstyle</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_vdstyle</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_vdstyle</item>
<item name="progressBarStyle">@style/ProgressBar.Vdstyle</item>
</style>
<style name="ActionBar.Transparent.Vdstyle" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/ab_transparent_vdstyle</item>
<item name="progressBarStyle">@style/ProgressBar.Vdstyle</item>
</style>
<style name="PopupMenu.Vdstyle" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_vdstyle</item>
</style>
<style name="DropDownListView.Vdstyle" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_vdstyle</item>
</style>
<style name="ActionBarTabStyle.Vdstyle" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_vdstyle</item>
</style>
<style name="DropDownNav.Vdstyle" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_vdstyle</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_vdstyle</item>
<item name="android:dropDownSelector">@drawable/selectable_background_vdstyle</item>
</style>
<style name="ProgressBar.Vdstyle" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_vdstyle</item>
</style>
<style name="ActionButton.CloseMode.Vdstyle" parent="@style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_vdstyle</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Vdstyle.Widget" parent="@style/Theme.AppCompat">
<item name="popupMenuStyle">@style/PopupMenu.Vdstyle</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Vdstyle</item>
</style>
</resources>
heirarchy是
RES - &GT; drawable(包含发电机的所有资产) - &GT;值(包含由web应用程序生成的样式xml)
两者都处于同一水平。
重复的例子
下面的是我的标签,其中包含样式 我希望这能改善我的问题
谢谢!