【发布时间】:2015-03-24 21:21:12
【问题描述】:
我的布局中有一个ImageView,请参见下面的代码。当我尝试将 src 属性设置为我的启动器图标时,我收到以下错误:
Cannot resolve symbol '@drawable/ic_launcher'
ic_launcer.png 被添加到我的 drawables 文件夹中,见下图。为什么我不能在我的ImageView 中引用我的图像?
项目结构:
布局.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_weight="1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
【问题讨论】:
标签: android