我有一點問題。我的應用程序將使用很多外部資源來顯示按鈕,背景,字段等。問題是我想讓它適合每個尺寸的手機。如何爲Android設置背景圖片?
如果我有一個圖像500x500它不會自動縮放以適應700x800的電話。這種類型的問題有哪些常見的修復?
編輯:
<FrameLayout 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"
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=".MainActivity" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"
android:src="@drawable/blue_bg_login" />
</FrameLayout>
從你真的無法看到圖像,但它具有圖像周圍的邊框,在任何尺寸的手機分辨率。藍色應該是灰色頂部的寬度。
請張貼代碼你試過什麼,結果是什麼? –
你是如何設置背景的? –
只是爲了確保你是'ImageView'來設置你的背景? –