我正在设计一个布局,我将以位图为中心,并且我想要左边的&右边距位图缩放(水平)以填充屏幕,以便我的中心项目可以是一个装饰的标题栏,左边的&右边是与中心位图背景匹配的填充位图,因此水平延伸。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