开发者社区> 问答> 正文

Android:应用报错匹配名称 ?报错

平台:4.3

API Level:18

AndroidManifest.xml:

<uses-sdk
    android:minSdkVersion="18"
    android:targetSdkVersion="18" />

values-v14\styles.xml:

  <resources>

<!--
    Base application theme for API 14+. This theme completely replaces
    AppBaseTheme from BOTH res/values/styles.xml and
    res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
</style>

 <style name="CustomActionBarTheme"
       parent="@style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<style name="MyActionBar"
       parent="@style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@drawable/actionbar_background</item>
</style>

报错:No resource found that matches the given name '@style/ Theme.Holo.Light.DarkActionBar'

展开
收起
爱吃鱼的程序员 2020-06-23 16:15:49 451 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    加上android:试试

    <stylename="CustomActionBarTheme"parent="@android:style/Theme.Holo.Light.DarkActionBar"><itemname="android:actionBarStyle">@style/MyActionBar</item></style>

    如果是低版本的,则要导入support包,可以不加android

    "@android:style/Theme.Holo.Light.DarkActionBar">

    你丢了Android关键字。@Android

    2020-06-23 16:16:06
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
58同城Android客户端Walle框架演进与实践之路 立即下载
Android组件化实现 立即下载
蚂蚁聚宝Android秒级编译——Freeline 立即下载