我想为我的应用实现启动画面,我正在使用此代码来显示图像,但图像居中并且未拉伸到整个屏幕。我该如何解决这个问题? 非常感谢你。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:src="@drawable/splash"
android:id="@+id/splash"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ImageView>
</RelativeLayout>
答案 0 :(得分:4)
尝试
<ImageView android:id="@+id/splash" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/splash"
android:scaleType="fitXY" />
android:scaleType="fitXY"
负责拉伸图像。