我在使用Android Lollipop (API 21)、Studio(64)和Java 7创建了一个新项目。当我尝试在主布局(相对布局)上添加背景时,出现了错误。
我的res文件夹结构如下图所示:
注意:我已经将720x1280的图片放置在所有drawable*文件夹中。
以下是我的XML代码:
我尝试使用PNG / JPG格式,但仍然遇到相同的错误。有人能告诉我哪里出了问题吗?
我参考了这些内容,但它们与我的问题无关或不能解决我的问题。 Couldn't resolve resource @drawable/backround.png RelativeLayout "Couldn't resolve resource..." Android Android image can't convert to drawable
我的res文件夹结构如下图所示:
注意:我已经将720x1280的图片放置在所有drawable*文件夹中。
以下是我的XML代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:padding="0dp"
android:background="@drawable/homebackground">
</RelativeLayout>
我尝试使用PNG / JPG格式,但仍然遇到相同的错误。有人能告诉我哪里出了问题吗?
我参考了这些内容,但它们与我的问题无关或不能解决我的问题。 Couldn't resolve resource @drawable/backround.png RelativeLayout "Couldn't resolve resource..." Android Android image can't convert to drawable
是的
,运行 -是的,但没有后台运行
- SimpleGuy