我创建了一个简单的应用程序并将LinearLayout的背景设置为图像.当我运行它时,不要显示背景图像.我看到这行日志:
W/PackageManager﹕ Failure retrieving resources for vania.backgroundtest: Resource ID #0x0
为什么无法显示背景图片?
这是我的布局代码:
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@drawable/backimage"
>
这是我的Java代码:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
这很明显:
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
我使用了1920 * 1080(412 KB)的.jpg图像