1

このようなテーブルレイアウトを作成する必要があります。いろいろやってみたのですが、同じようにはできません。

ここに私が達成しようとしているもののスクリーンショットがあります。

ここに画像の説明を入力

ありがとうございました。

4

2 に答える 2

0

RelativeLayoutはこれを簡単に実現できると思います。

于 2012-11-11T19:46:10.563 に答える
0

まあ、あなたの要件に応じていくつかの変更を加えて、このようにすることができます..

<?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:background="@android:color/background_light" >

    <LinearLayout
        android:id="@+id/first_row"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="2" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Nombre : "
            android:textColor="@android:color/black" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="Enter your field"
            android:textColor="@android:color/black" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/second_row"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/first_row"
        android:orientation="horizontal"
        android:weightSum="3" >

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Localizame" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Nombre : "
            android:textColor="@android:color/black" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="Enter your field"
            android:textColor="@android:color/black" />
    </LinearLayout>

        <LinearLayout
            android:layout_below="@id/second_row"
        android:id="@+id/third_row"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="2" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Latitud : "
            android:textColor="@android:color/black" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="Enter your field"
            android:textColor="@android:color/black" />
    </LinearLayout>

            <LinearLayout
        android:id="@+id/fourth_row"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/third_row"
        android:orientation="horizontal"
        android:weightSum="2" >

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Anadir Amigo" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="Enter your field"
            android:textColor="@android:color/black" />
    </LinearLayout>
</RelativeLayout>
于 2012-11-11T20:22:41.697 に答える