英文:
Problem: No drawable files from Resource folder seen on ImageView
问题
我在搜索了这个问题后没有找到任何答案。我两天前开始在Android Studio(Java)上进行编程。所以我是一个超级初学者。
每个YouTube视频(最新的)或教程我看的时候,他们都会将一张图片复制到Res文件夹内的drawable文件夹中,当他们将ImageView拖到布局中时,会出现一个弹出窗口,其中包含所有的图片和资源,这意味着他们添加的图片已经在项目中,可以作为ImageView的图片来源。
例如:
这个教程添加了一个horse.jpg,已经可以在drawable文件夹中看到
与此同时,我的Android Studio中也有一个beginner-gym-routine.jpg文件在drawable文件夹中(如左侧所示),但是当我拖动一个ImageView时,弹出窗口中没有任何内容(已经在各处搜索过)。
例如:
我的Android Studio
我不明白出了什么问题,或者我做错了什么。非常感谢任何帮助。谢谢!
英文:
I searched for this question and couldnt find any answers. I started coding 2 days ago on Android Studio (Java). So I'm a super beginner.
Every youtube video (up to date) or tutorial that I watch, they copy an image to the drawable folder inside the Res folder and when they drag an ImageView to the layout a pop up screen appears, which contains all the images and resources, meaning the picture they added is there on the project ready to be added as the image source of the ImageView.
Example:
This tutorial adding a horse.jpg that can be seen already on the drawable folder
Meanwhile my Android Studio also has a beginner-gym-routine.jpg file on the drawable folder (as also can be seen on the left side) but NOTHING appears on the pop up screen when I drop an ImageView (Searched everywhere).
Example:
My Android Studio
I dont understand what is going wrong or what I'm doing wrong. Any help is appreciated. Thank you!
答案1
得分: 0
这是因为您的图像中包含特殊字符。
像您的图像 beginner-gym-routine.jpg
包含了 "-" 这个字符,导致了这个问题。
只需重命名您的图像并移除破折号。
希望能解决问题
英文:
This happens when your image has special characters in it.
Like your image beginner-gym-routine.jpg
contains "-" which is causing this.
You just rename your image and remove the dashes.
Hope it works out
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论