我想要两个按钮,如下所示: [ 使用 ] [ 取消 ] (这些只是带有背景图像的按钮,而不是 ImageButtons)
但是结果很奇怪,第一个按钮填满了所有的空间,在线性布局中是这样的:[.............Use............] 而取消按钮是未显示。两个按钮的 layout_width 都是“wrap_content”,而线性布局的方向是水平的,有什么问题?
得到一个代码:
<LinearLayout
android:layout_width="fill_parent"
android:orientation="horizontal"
android:id="@+id/linearLayout2"
android:layout_gravity="bottom"
android:layout_height="fill_parent"
android:layout_weight="1">
<Button
android:text="Use"
android:height="14dp"
android:textSize="15sp"
android:textColor="#ffffff"
android:background="@drawable/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/UseButtonDialog"
android:layout_gravity="bottom">
</Button>
<Button android:text="Cancel"
android:background="@drawable/button1"
android:height="14dp"
android:textSize="15sp"
android:textColor="#ffffff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/CancelButtonDialog"
android:layout_gravity="bottom">
</Button>
</LinearLayout>
我应该对图像做些什么?