的底部稍上方的位置我需要在屏幕底部放置一个按钮,在它下面留下一些空间。 换句话说,我使用这两个属性为我的按钮 -如何将一个按钮放在android
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
但幅度不会属性工作时,我使用alignParentBottom和按钮枝只在底部。请告诉我如何将它放在底部以上一点。
这里的XML
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:background="@drawable/board"
android:layout_marginLeft="10dp"
android:layout_marginRight="60dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="10dp">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Type of Lesion"
android:textColor="#8B0A50"
android:layout_marginTop="40dp"
android:id="@+id/disease_listheader_textview"
android:drawableBottom="@drawable/underline"/>
<ListView
android:id="@+id/disease_listview"
android:layout_below="@id/disease_listheader_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:divider="@drawable/divider"
android:layout_marginLeft="40dp"
android:layout_marginBottom="50dp"
android:cacheColorHint="#00000000"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/disease_search_button"
android:layout_centerHorizontal="true"
android:background="@drawable/disease_search_btn"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"/>
</RelativeLayout>
能你把你的布局xml在这里? –
显示完整的按钮xml与外部布局.. – Ronnie
@RahulChoudhary我已经把xml – Ankit