首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解析符号“@drawable”

无法解析符号“@drawable”
EN

Stack Overflow用户
提问于 2014-12-03 01:33:34
回答 1查看 5.2K关注 0票数 2
代码语言:javascript
复制
<ImageView
        android:id="@+id/imgdice1"
        android:layout_width="141dp"
        android:layout_height="141dp"
        android:layout_column="7"
        android:layout_row="0"
        android:onClick="dice1"
        android:src="@drawable/imgdice1" 
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

在“android:src=”@drawable/imgdice1 1“上面写着无法解析符号。我在所有的绘图中都有图像,它不工作。我有一个划痕程序,它在那里工作得很好。当我试图在虚拟设备上添加imageView时,它没有显示我的图像列表。这是我所遇到的问题的一个视觉。http://imgur.com/8MITTkM

整个布局代码-

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/table">

<GridLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/img1stdice"
        android:layout_row="3"
        android:layout_column="4"
        android:src="@drawable/imgdice1"/>

    <Button
        android:id="@+id/btnRollDice"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_column="4"
        android:layout_row="10"
        android:text="Roll Dice"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

</GridLayout>

</RelativeLayout>

我希望我能尽快解决这个问题,谢谢。:)

EN

回答 1

Stack Overflow用户

发布于 2016-11-08 20:53:48

您没有将图像或可绘制的名称为"imgdmce1“添加到可绘制文件夹中。您只有两个1.ic_launcher 2.表,请在您的项目中的可绘图文件夹中添加您的图像,我认为您与可绘制的可绘图名称和图像视图id有一些混淆。两者是不同的

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27262182

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档