android xml样式文件中的错误

时间:2013-03-08 16:55:10

标签: android android-layout

这是完整的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>

1 个答案:

答案 0 :(得分: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>