我的佈局有9個補丁的背景圖片,當顯示分辨率小於圖片尺寸(800x480px)時,它可以正常工作。但是,當我在具有更大分辨率的設備(例如1280x800px)上對其進行測試時,它的佈局會被破壞。這裏有兩張照片:9-補丁背景圖片的佈局問題
下面是相關佈局代碼:
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/chalkboard"
android:gravity="top|center"
android:orientation="vertical" >
總而言之,9補丁不起作用當圖像尺度向上。但是,是什麼原因以及如何處理?
此致敬禮!
在哪個文件夾你把這個圖像? –
9個補丁位於ldpi,mdpi和hdpi中。由於OutOfMemory問題,我沒有用於xhdpi的映像。 – Namenlos
問題在於你的圖片,你應該拉伸邊角而不是內容 –