【发布时间】:2011-12-28 15:47:30
【问题描述】:
我有一个带有背景图像的相对布局,但我希望图像填充所有布局空间,我认为这是一个填充问题,我设置为 -1dip,这不起作用。 同样在将我的填充设置为 -1dip 之前,当我使用分层查看器检查填充时。 这是我的xml
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/gridView"
android:background="@drawable/tool_bar"
android:gravity="center"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/locate" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imageView1"
android:src="@drawable/orbit" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/imageView2"
android:src="@drawable/search" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imageView3"
android:src="@drawable/snap" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imageView4"
android:src="@drawable/profile" />
</RelativeLayout>
thanks
【问题讨论】:
标签: android background padding android-relativelayout