我应该在哪里将PNG文件与Android中的ImageButton相关联?

我对
Android很新.

我创建了一个ImageButton. main.xml包括如下代码段.

<ImageButton
android:id="@+id/button1"
android:layout_width="50px"
android:layout_height="50px"
android:src="@drawable/cat"
android:layout_x="50px"
android:layout_y="52px"
>

我必须把“cat.png”放在哪里.我需要将其重命名为其他内容吗?

最佳答案 将它放在Android项目的res / drawable /文件夹中.保持名称cat.png

点赞