Tôi có một ImageView
trong bố cục của tôi, xem mã bên dưới. Khi tôi đang cố gắng để thiết lập các thuộc tính src
là biểu tượng khởi chạy của tôi, tôi nhận được lỗi sau:Không thể giải quyết biểu tượng @ drawable/ic_launcher
Cannot resolve symbol '@drawable/ic_launcher'
ic_launcer.png được thêm vào thư mục drawables của tôi, xem dưới đây hình ảnh. Tại sao tôi không thể tham chiếu hình ảnh của mình trong số ImageView
?
cấu trúc dự án:
Layout.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>
Cảm ơn bạn đã giải thích sự khác biệt giữa các thư mục 'drawable' và' mipmap'. – Marcus