英文:
show an image on Image view tool by choose
问题
我在Android Studio中的ImageView遇到了问题,图片存在于drawable文件夹中,但在ImageView中不可选,并且扩展名是"png",有没有有帮助的解决方案。
英文:
I have a problem with Image view in android studio , the Image is exist in drawable folder but is not available to choose by Image view and the extension is "png" , any helpful solutions .
答案1
得分: 0
你好,可能你的图片名称包含大写字母或符号(只有“_”符号在名称中是允许的)。
如果不是这种情况,请记得以以下方式放置图片:android:src="@drawable/my_happy_image"
,或者通过编程方式实现:
ImageView myImageView = findViewById(R.id.my_image_view);
myImageView.setImageDrawable(getDrawable(R.drawable.my_happy_image));
英文:
Hi probably your image name contains Uppercases or symbols(only '_' is permited in names).
If this is not your case, remember to place the image in the following way android:src="@drawable/my_happy_image
or programatically
ImageView myImageView = findViewById(R.id.my_image_view);
myImageView.setImageDrawable(getDrawable(R.drawable.my_happy_image));
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论