我有一个ImageView在RelativeLayout中的5个按钮,并给每个顶部的视图留出一定的余量。但是从顶端的保证金不符合我的条件。 我的代码是:从顶部的边距不与RelativeLayout一起工作?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<fragment
android:name="motorpool.orbitsysindia.com.motorpool.model.splash.view.fragment.FragmentHeaderLineColor"
android:layout_width="match_parent"
android:tag="@string/fragment_header"
android:layout_height="wrap_content">
</fragment>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_alignParentTop="true"
android:layout_below="@+id/header">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageCar"
android:layout_centerHorizontal="true"
android:src="@drawable/mu7"/>
<motorpool.orbitsysindia.com.motorpool.util.custom.ButtonBold
android:id="@+id/btnJointInsp"
style="@style/ButtonTextMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/imageCar"
android:layout_marginTop="20dp"
android:text="@string/menuJointInsp" />
<motorpool.orbitsysindia.com.motorpool.util.custom.ButtonBold
android:id="@+id/btnVehRec"
style="@style/ButtonTextMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btnJointInsp"
android:layout_marginTop="200dp"
android:text="@string/menuVehicleRec" />
<motorpool.orbitsysindia.com.motorpool.util.custom.ButtonBold
android:id="@+id/btnRecIns"
style="@style/ButtonTextMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btnVehRec"
android:layout_marginTop="20dp"
android:text="@string/menuRecIns" />
<motorpool.orbitsysindia.com.motorpool.util.custom.ButtonBold
android:id="@+id/btnPdi"
style="@style/ButtonTextMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btnRecIns"
android:layout_marginTop="20dp"
android:text="@string/menuPDI" />
<motorpool.orbitsysindia.com.motorpool.util.custom.ButtonBold
android:id="@+id/btnLocation"
style="@style/ButtonTextMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btnPdi"
android:background="@drawable/vehicle_list"
android:text="@string/menuLocation" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:gravity="center">
<fragment
android:name="motorpool.orbitsysindia.com.motorpool.model.splash.view.fragment.FragmentFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_footer" />
</RelativeLayout>
</RelativeLayout>
任何形式的帮助是由我赞赏:
没有工作..? – Champandorid