-3

这是完整的 xml 文件,并且在此 xml 文件中的每个样式名称标记的开头都会发生错误

<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="background">@drawable/nav_bar</item>
    <item name="android:background">@drawable/nav_bar</item>
    <item name="android:cacheColorHint">@drawable/nav_bar</item>
</style>

<style name="Widget.Styled.TabView" parent="Widget.Sherlock.ActionBar.TabView">
    <item name="android:background">@drawable/tab_indicator_customize</item>
</style>

<style name="Widget.Styled.TabBar" parent="Widget.Sherlock.Light.ActionBar.TabBar">
    <item name="background">@color/space_menu</item>
    <item name="android:background">@color/space_menu</item>
    <item name="android:cacheColorHint">@color/space_menu</item>
</style>

<style name="Sherlock.__Widget.Holo.Spinner" parent="Widget">
    <item name="android:dropDownSelector">@drawable/abs__list_selector_holo_dark</item>
    <item name="android:popupBackground">@drawable/box_element</item>
    <item name="android:gravity">left|center_vertical</item>
    <item name="android:spinnerMode">dropdown</item>
    <item name="android:clickable">true</item>
    <item name="android:width">200dp</item>
</style>

4

1 回答 1

1

您必须将<style>标签包装在<resources>标签中:

<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="background">@drawable/nav_bar</item>
    <item name="android:background">@drawable/nav_bar</item>
    <item name="android:cacheColorHint">@drawable/nav_bar</item>
</style>

<style name="Widget.Styled.TabView" parent="Widget.Sherlock.ActionBar.TabView">
    <item name="android:background">@drawable/tab_indicator_customize</item>
</style>

<style name="Widget.Styled.TabBar" parent="Widget.Sherlock.Light.ActionBar.TabBar">
    <item name="background">@color/space_menu</item>
    <item name="android:background">@color/space_menu</item>
    <item name="android:cacheColorHint">@color/space_menu</item>
</style>

<style name="Sherlock.__Widget.Holo.Spinner" parent="Widget">
    <item name="android:dropDownSelector">@drawable/abs__list_selector_holo_dark</item>
    <item name="android:popupBackground">@drawable/box_element</item>
    <item name="android:gravity">left|center_vertical</item>
    <item name="android:spinnerMode">dropdown</item>
    <item name="android:clickable">true</item>
    <item name="android:width">200dp</item>
</style>

</resources>
于 2013-03-08T17:03:38.770 回答