大佬教程收集整理的这篇文章主要介绍了android – 资源$NotFoundException drawable-xhdpi来自drawable资源,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
有任何想法吗?
android.content.res.resources$NotFoundException: File res/drawable-xhdpi/action_bar_search_icon.png from drawable resource ID #0x7f02007f at android.content.res.resources.loadDrawable(resources.java:1714) at android.content.res.resources.getDrawable(resources.java:581) at com.actionbarsherlock.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:384) at com.actionbarsherlock.internal.view.menu.ActionMenuItemView.initialize(ActionMenuItemView.java:128) at com.actionbarsherlock.internal.view.menu.Actionmenupresenter.bindItemView(Actionmenupresenter.java:192) at com.actionbarsherlock.internal.view.menu.basemenupresenter.getItemView(Basemenupresenter.java:176) at com.actionbarsherlock.internal.view.menu.Actionmenupresenter.getItemView(Actionmenupresenter.java:178)
xhdpi仅在Android SDK 8中引入,因此如果您定位SDK 7及更早版本,则可能会遇到问题:
Only use XHDPI drawables in Android app?
Android可能无法访问xhdpi目录的另一个原因是设备是否在屏幕兼容模式下运行:
Android – Extra large images placed in res/drawable-xhdpi aren’t showing on tablet emulator,why?
另一个可能的原因是,如果您的drawable非常小,并且其中一个尺寸由于缩放而舍入为零:
Android resource not found because of width and height
最后,有些OEM版本的Android可能会以非标准的方式实现这一点(例如,如果他们的设备是hdpi,则不通过搜索xhdpi目录来“提高性能”):
以上是大佬教程为你收集整理的android – 资源$NotFoundException drawable-xhdpi来自drawable资源全部内容,希望文章能够帮你解决android – 资源$NotFoundException drawable-xhdpi来自drawable资源所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。