如何防止闪屏图像拉伸

时间:2016-06-03 13:37:28

标签: android splash-screen

我正在创造一个游戏 目前,对于我的闪屏,我使用的是图像 问题在于它的延伸 陶氏我会阻止它吗?

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">

1 个答案:

答案 0 :(得分:6)

始终使用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 替换您的图片。

注意:作为信息较少的问题,我假设您只使用一个图像作为启动画面。