gpt4 book ai didi

android - 错误 :String types not allowed

转载 作者:太空狗 更新时间:2023-10-29 15:54:13 24 4
gpt4 key购买 nike

我是安卓新手。我面临以下错误:不允许的字符串类型

EDIT: I have kept the image.jpg in Resources -> drawwble- hdpi

引用以下代码:Strings.xml

 <drawable name="test_image">image.jpg</drawable>

Activity_main.xml

<ImageView android:id="@+id/imageDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/desc"
android:src="@drawable/test_image" />

Android_manifest

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />

最佳答案

  1. 将您的图像放在 res/drawable 文件夹中。
  2. 同时删除文件扩展名。

希望对您有所帮助。

关于android - 错误 :String types not allowed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17002272/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com