2011-05-02 140 views
0

我有一個scrollview.i的xml文件想要爲背景圖像,但我嘗試了它在許多圖像大小,它pixelates ..什麼將按順序圖像的最佳尺寸使用它作爲背景?謝謝背景圖像的尺寸

回答

0

您是否嘗試過使用fill_parent或wrap_content?你的問題還是有點不清楚。從res文件夾中嘗試android:background =「@ drawable/ur_image」。

+0

是的我做到這一點,但我的照片是縮放 – kostas 2011-05-02 09:26:39

0

我會創造一個風格:

<style name="styBackground"> 
    <item name="android:layout_width">fill_parent</item> 
    <item name="android:layout_height">fill_parent</item> 
    <item name="android:src">@drawable/default_background</item> 
    <item name="android:scaleType">centerCrop</item> 
</style> 

並將其應用到你想在後臺每個屏幕:

<ImageView 
    style="@style/styBackground" 
    /> 

的centerCrop將保證它不舒展,和FILL_PARENT的導致圖像填滿屏幕,但沒有超過必要的。對於像素化,請確保您的圖像足夠大以支持市場上的最高分辨率,例如854x480。