0

如何从我的项目中引用 HoloEverywhere 主题?这是我的 styles_course.xml 文件,它需要一个父主题,最好是带有深色操作栏的全息灯。请注意,父属性为空。

   <?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator

     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.course" parent="">
    <item name="android:windowBackground">@color/background</item>
    <item name="android:colorBackground">@color/background</item>
    <item name="actionBarItemBackground">@drawable/selectable_background_course</item>
    <item name="popupMenuStyle">@style/course_PopupMenu</item>
    <item name="dropDownListViewStyle">@style/course_DropDownListView</item>
    <item name="actionBarTabStyle">@style/course_ActionBarTabStyle</item>
    <item name="actionDropDownStyle">@style/course_DropDownNav</item>
    <item name="actionBarStyle">@style/course_solid_ActionBar</item>

    <item name="android:actionBarItemBackground">@drawable/selectable_background_course</item>
    <item name="android:popupMenuStyle">@style/course_PopupMenu</item>
    <item name="android:dropDownListViewStyle">@style/course_DropDownListView</item>
    <item name="android:actionBarTabStyle">@style/course_ActionBarTabStyle</item>
    <item name="android:actionDropDownStyle">@style/course_DropDownNav</item>
    <item name="android:actionBarStyle">@style/course_solid_ActionBar</item>
    <item name="android:panelBackground">@drawable/menu_hardkey_panel_course</item>

            <!-- Light.DarkActionBar specific -->
    <item name="actionBarWidgetTheme">@style/Theme.course.widget</item>
    <item name="android:actionBarWidgetTheme">@style/Theme.course.widget</item>

</style>

<style name="course_solid_ActionBar" parent="@style/Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="background">@drawable/ab_solid_course</item>
    <item name="backgroundStacked">@drawable/ab_stacked_solid_course</item>
    <item name="backgroundSplit">@drawable/ab_bottom_solid_course</item>
    <item name="progressBarStyle">@style/course_ProgressBar</item>

    <item name="android:background">@drawable/ab_solid_course</item>
    <item name="android:backgroundStacked">@drawable/ab_stacked_solid_course</item>
    <item name="android:backgroundSplit">@drawable/ab_bottom_solid_course</item>
    <item name="android:progressBarStyle">@style/course_ProgressBar</item>
</style>

<style name="course_transparent_ActionBar" parent="@style/Widget.Sherlock.ActionBar">
    <item name="background">@drawable/ab_transparent_course</item>
    <item name="progressBarStyle">@style/course_ProgressBar</item>

    <item name="android:background">@drawable/ab_transparent_course</item>
    <item name="android:progressBarStyle">@style/course_ProgressBar</item>
</style>

<style name="course_PopupMenu" parent="@style/Widget.Sherlock.ListPopupWindow"> 
    <item name="android:popupBackground">@drawable/menu_dropdown_panel_course</item>    
</style>

<style name="course_DropDownListView" parent="@style/Widget.Sherlock.ListView.DropDown">
    <item name="android:listSelector">@drawable/selectable_background_course</item>
</style>

<style name="course_ActionBarTabStyle" parent="@style/Widget.Sherlock.ActionBar.TabView">
    <item name="background">@drawable/tab_indicator_ab_course</item>

    <item name="android:background">@drawable/tab_indicator_ab_course</item>
</style>

<style name="course_DropDownNav" parent="@style/Widget.Sherlock.Spinner.DropDown.ActionBar">
    <item name="background">@drawable/spinner_background_ab_course</item>

    <item name="android:background">@drawable/spinner_background_ab_course</item>
    <item name="android:popupBackground">@drawable/menu_dropdown_panel_course</item>
    <item name="android:dropDownSelector">@drawable/selectable_background_course</item>
</style>

<style name="course_ProgressBar" parent="@style/Widget.Sherlock.ProgressBar.Horizontal">
    <item name="android:progressDrawable">@drawable/progress_horizontal_course</item>
</style>

<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.course.widget" parent="@style/Theme.Sherlock">
    <item name="popupMenuStyle">@style/course_PopupMenu</item>
    <item name="dropDownListViewStyle">@style/course_DropDownListView</item>

    <item name="android:popupMenuStyle">@style/course_PopupMenu</item>
    <item name="android:dropDownListViewStyle">@style/course_DropDownListView</item>
</style>

谢谢!

4

3 回答 3

1

为应用程序或活动创建自己的主题,如下所示:

<style name="AppTheme" parent="Holo.Theme">
<!-- Or use <style name="AppTheme" parent="@style/Holo.Theme"></style> -->
</style>
  1. 当然,如果您从项目中引用 holoeverywhere 库项目,这将有效。
  2. Activity应该扩展org.holoeverywhere.app.Activity
  3. 当然,您应该将此主题应用于 Manifest 中的活动或应用程序。

还有像Holo.Theme.Light和这样的主题Holo.Theme.Light.DarkActionBar

这是所有样式的列表

于 2012-12-25T08:10:27.997 回答
0
<resources>
    <style name="MyTheme" parent="@android:styl e/Theme.Holo">
        <!-- Any customizations for your app ru nning on devices with Theme.Holo here -->
     </style>
</resources>

这里还有一个很好的资源来了解更多信息:http ://android-developers.blogspot.com/2012/01/holo-everywhere.html

于 2012-12-09T06:56:14.007 回答
0

你试过这个吗?

"@style/Holo.Theme.Sherlock.Light.DarkActionBar"

编辑:

对于 holoeverywhere 1.4 它

@style/Holo.Theme.Light.DarkActionBar
于 2012-12-10T13:18:00.510 回答