2013-12-10 70 views
0

我粘貼下面我的代碼:問題是圖像被拉伸......閃屏中的Nexus 4拉伸

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".SplashScreen" 
    android:background="@color/black" > 

    <ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     android:src="@drawable/splashscreen"/> 

</RelativeLayout> 

回答

0

你應該使用9頁圖像。您可以從9-path generator.生成9個補丁的圖像。

後修改您的ImageView等作爲

<ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:scaleType="fitCenter" 
     android:src="@drawable/splashscreen"/> 
+0

感謝您的回覆。問題已解決,我將scaleType更改爲metrix。 – Mubarak

0

使用WRAP_CONTENT代替match_parent:

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/splashscreen"/> 
+0

感謝您的答覆。問題已解決,我將scaleType更改爲metrix。 – Mubarak