我有一个RelativeLayout
与2 Button
s里面。如何设置图像RelativeLayout背景
一个Button
有layout_alignParentLeft="true"
财产和其他按钮有layout_alignParentRight="true"
我想设置我的RelativeLayout的背景,显示在中间的图像。我有一个play.9.png
在我的绘制和使用下面的代码:
<RelativeLayout
android:id="@+id/relativeLayout12"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:background="@drawable/play" // background line
>
<Button
android:id="@+id/bAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="but1" />
<Button
android:id="@+id/bSync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="but2" />
</RelativeLayout>
但是当我使用的背景线,我Button
小号想念自己的位置
见下
的形象,但我希望我的RelativeLayout
是这样的:
什么是错的?
请问您可以上传'play.9.png'图片吗?即使你的代码对我来说工作正常 – sunil 2012-07-31 11:20:20