我有一個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