0

画面にヒーザーとフッターを実装したいので、コードを試しましたが、送信ボタンとフッターの間にスペースがあるはずですが、デバイスではボタンがフッターに接続されているように表示されます。1つの解決策を実行しました私はscrollviewにハードコード値を与えましたが、それは適切な方法ではありません。誰かが私にこれに対する適切な解決策を与えることができますか。

私のコードは

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center_horizontal"
    android:background="@drawable/bckcolor"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/upper"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/payment_03" >
    </RelativeLayout>

    <ScrollView
        android:id="@+id/scroll"
        android:layout_width="wrap_content"
        android:layout_height="250dp"
        android:layout_below="@+id/upper"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="10dip"
        android:layout_marginTop="15dip" >

        <RelativeLayout
            android:id="@+id/middle"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/my_border"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/actntlist"
                android:layout_width="300dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:hint="Enter Phone number" />

            <EditText
                android:id="@+id/receivercode"
                android:layout_width="300dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/actntlist"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:hint="Enter receiver code" />

            <EditText
                android:id="@+id/amount"
                android:layout_width="300dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/receivercode"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:hint="Enter amount" />

            <EditText
                android:id="@+id/remarks"
                android:layout_width="300dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/amount"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:hint="Enter remarks" />

            <EditText
                android:id="@+id/pin"
                android:layout_width="300dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/remarks"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:hint="Enter Pin number" />

            <Button
                android:id="@+id/submit"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pin"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:text="submit" >
            </Button>
        </RelativeLayout>
    </ScrollView>

    <RelativeLayout
        android:id="@+id/bottom"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true" >

        <TextView
            android:id="@+id/foot"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_alignParentBottom="true"
            android:background="@drawable/footer"
            android:text="" >
        </TextView>
    </RelativeLayout>

</RelativeLayout>
4

1 に答える 1

0

スクロールビューに下マージンを設定できるため、下からいくらかのスペースが残ります。これを試して。

   <ScrollView
        android:id="@+id/scroll"
        android:layout_width="wrap_content"
        android:layout_height="250dp"
        android:layout_below="@+id/upper"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="10dip"
        android:layout_marginTop="15dip"
        android:layout_marginBottom="15dip" >
于 2012-05-25T12:34:50.697 に答える