我正在使用Android工作室,实际上我正在设置Action bar。
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar"
parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:background">@color/oranzova</item>
<item name="android:icon">@drawable/ic_launcher.png</item>
</style>
</resources>
我仍然收到错误:
Error:(12, 35) No resource found that matches the given name (at 'android:icon' with value '@drawable/ic_launcher.png').
但无论我使用哪种资源。如果我使用@ raw / icon.png我仍会得到同样的错误。我尝试使缓存无效/重新启动,但没有帮助。
答案 0 :(得分:1)
资源文件中不需要像*.png
这样的文件扩展名。所以只需改变你的界限:
<item name="android:icon">@drawable/ic_launcher.png</item>
到
<item name="android:icon">@drawable/ic_launcher</item>