我已经在我的Android项目中添加了要在UI中使用的图片。我已经将文件my-image.png添加到了drawable目录中(添加到了使用该项目创建的所有4个drawable目录中),并添加ImageView
了布局:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/textView"
android:layout_marginBottom="63dp"
android:src="@drawable/my-image" />
问题是我得到以下错误:
渲染问题
无法将@ drawable / my-image转换为drawable
这是捕获:
另外,如果我尝试编译项目,则会收到以下错误:
Gradle:任务':MyProject:processDebugResources'的执行失败。
为什么会出现这些错误,我该如何解决?我想念什么吗?我刚刚开始Android开发。
Gradle: Execution failed for task ':MyProject:processDebugResources'.
因为您在参考资料中有命名约定错误
file name: must contain only [a-z0-9_.]
将文件名重命名为 my_image
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句