如何让我的背景图像填满整个屏幕?我尝试了几个不同的建议,似乎没有任何工作。我的应用背景不会填满屏幕
下面是我activity_main.xml中的代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.andrewvanpeter.upandaway.MainActivity">
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/background_flat_720x1280" />
</android.support.constraint.ConstraintLayout>
match_parent解决方案无法正常工作;也许我在做别的事情。但是,直接设置背景确实奏效。非常感谢你! – CheetahBongos
没问题,很高兴!也许你在某处有填充或边距...或者你必须适合ImageView。 –