如何防止启动画面图像拉伸
How to prevent a splash screen image from stretching
我正在制作游戏。
目前,对于我的启动画面,我使用图像。
问题是它会伸展。
我该如何预防?
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="hitesh.asimplegame.SplashScrean"
android:background="@drawable/mulalo">
始终使用 Imageview 显示图像。
初始屏幕示例 xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash_bg"
android:scaleType="centerCrop"
/>
</RelativeLayout>
将您的图片替换为 splash_bg。
注意:作为信息较少的问题,我假设您只使用一张图片作为启动画面。
我正在制作游戏。
目前,对于我的启动画面,我使用图像。
问题是它会伸展。
我该如何预防?
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="hitesh.asimplegame.SplashScrean"
android:background="@drawable/mulalo">
始终使用 Imageview 显示图像。
初始屏幕示例 xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash_bg"
android:scaleType="centerCrop"
/>
</RelativeLayout>
将您的图片替换为 splash_bg。
注意:作为信息较少的问题,我假设您只使用一张图片作为启动画面。