我是安卓新手。 我面临以下错误: 不允许的字符串类型
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" />
最佳答案
- 将您的图像放在
res/drawable
文件夹中。 - 同时删除文件扩展名。
希望对您有所帮助。
关于android - 错误 :String types not allowed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17002272/