我有两个带有 xml 背景的按钮,我想在它们之间保留一些空间,因为它们彼此正好过去,我也想在它们上面放白线,我会告诉你我是如何尝试的,但它不起作用我
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dip"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:background="@drawable/button_selector"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
android:text="@string/b_save" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#FFFFFF"
android:gravity="center"
android:background="@drawable/button_selector"
android:text="@string/b_cancel" />
</LinearLayout>
xml背景
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<padding android:top="10dip"
android:bottom="10dip"/>
<!-- Gradient Bg for listrow -->
<gradient
android:useLevel="false"
android:angle="270"
android:centerColor="#000000"
android:endColor="#FFFFFF"
android:startColor="#808080" />
</shape>