我正在設計一個佈局,我將以位圖爲中心,並且我想要左邊的&右邊距位圖縮放(水平)以填充屏幕,以便我的中心項目可以是一個裝飾的標題欄,左邊的&右邊是與中心位圖背景匹配的填充位圖,因此水平延伸。Android視圖佈局縮放位圖
但我所看到的是位圖之間有一個空格。左邊的&右邊的比例尺,但它們之間有一個空間。
如什麼,我得到的是:
http://www.58seconds.com/getting.png
我要的是:
http://www.58seconds.com/want.png
任何想法?
這裏是佈局的代碼,我使用的一個片段:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageView
android:layout_width="1dp"
android:layout_weight="1"
android:layout_height="45sp"
android:src="@drawable/mdjleftfiller"
android:layout_gravity="top"
android:gravity="top"
android:scaleType="fitXY"
/>
<ImageView
android:id="@+id/command_selection_topImage"
android:layout_width="wrap_content"
android:layout_height="45sp"
android:src="@drawable/top_image"
android:layout_gravity="top"
android:gravity="top"
android:layout_weight="0"
/>
<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="45sp"
android:src="@drawable/mdjrightfiller"
android:layout_gravity="top"
android:gravity="top"
android:scaleType="fitXY"
/>
</LinearLayout>
是的,9貼片PNG是很好的解決方案。謝謝。 – Cris 2011-10-12 17:52:08