1

画像ボタンを画面の rt 側の下部に配置したいと考えています。コードを見てください。

<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"
tools:context=".MainActivity" >

<TableLayout
    android:id="@+id/tableLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_vertical" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Date of Birth:" />

        <Button
            android:id="@+id/dateButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@null"
            android:text="Select date" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Manual labour" />

        <EditText
            android:id="@+id/ed1"
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:inputType="number" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Gender :" />

        <RadioGroup
            android:id="@+id/radioSex"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >

            <RadioButton
                android:id="@+id/radioMale"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:checked="true"
                android:text="Male" />

            <RadioButton
                android:id="@+id/radioFemale"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Female" />
        </RadioGroup>
    </TableRow>

    <TableRow
        android:id="@+id/tableRow4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Occupation" />

        <Spinner
            android:id="@+id/spinner1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:entries="@array/occuaption_arrays"
            android:prompt="@string/occupation_prompt" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow5"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Monthly Income" />

        <Spinner
            android:id="@+id/spinner2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:entries="@array/income_arrays"
            android:prompt="@string/income_prompt" />
    </TableRow>
</TableLayout>



    <ImageButton
        android:id="@+id/next"
        android:layout_height="50dp"
        android:layout_width="50dp"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:contentDescription="dfg"
        android:src="@drawable/next"
        android:visibility="visible"/>

親として RelativeLayout を使用して、属性 android:layout_alignParentRight="true" および android:layout_alignParentBottom="true" を追加しようとしました

画像が非常に大きいのですが、問題になる可能性はありますか?

4

1 に答える 1

0

match-parent を TableLayout の幅と高さに設定しました。したがって、TableLayout は ImageButton とオーバーラップします。

以下のコードを使用してください...

 android:layout_width="match_parent"
 android:layout_height="wrap-content"
于 2012-12-04T08:08:55.577 に答える