0

同じレイアウトで1つの日付ピッカーと2つの時間ピッカーを使用しようとしていますが、レイアウトの最初の1つだけが表示されています。レイアウトに何か問題があるはずですが、まだエラーは見つかりませんでした。

layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#B5B5B5"
    android:orientation="vertical" >

    <include layout="@layout/actionbar_layout" />

    <LinearLayout
        android:id="@+id/new_conference_date"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#f8f9fe"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/new_conference_date_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="date:"
            android:textColor="#000000" />

        <TextView
            android:id="@+id/new_conference_date_value"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textColor="#000000" />

        <Button
            android:id="@+id/new_conference_date_picker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/new_conference_start"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#f8f9fe"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/new_conference_start_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="start:"
            android:textColor="#000000" />

        <TextView
            android:id="@+id/new_conference_start_value"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textColor="#000000" />

        <Button
            android:id="@+id/new_conference_start_picker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/new_conference_end"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#f8f9fe"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/new_conference_end_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="end:"
            android:textColor="#000000" />

        <TextView
            android:id="@+id/new_conference_end_value"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textColor="#000000" />

        <Button
            android:id="@+id/new_conference_end_picker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="" />
    </LinearLayout>

</LinearLayout>
4

2 に答える 2

1

これを試してください:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#B5B5B5"
android:orientation="vertical" >

<include layout="@layout/actionbar_layout" />

<LinearLayout
    android:id="@+id/new_conference_date"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#f8f9fe"
    android:orientation="horizontal" >

    <TextView
        android:id="@+id/new_conference_date_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="date:"
        android:textColor="#000000" />

    <TextView
        android:id="@+id/new_conference_date_value"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:textColor="#000000" />

    <Button
        android:id="@+id/new_conference_date_picker"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="" />
</LinearLayout>

<LinearLayout
    android:id="@+id/new_conference_start"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#f8f9fe"
    android:orientation="horizontal" >

    <TextView
        android:id="@+id/new_conference_start_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="start:"
        android:textColor="#000000" />

    <TextView
        android:id="@+id/new_conference_start_value"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:textColor="#000000" />

    <Button
        android:id="@+id/new_conference_start_picker"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="" />
</LinearLayout>

<LinearLayout
    android:id="@+id/new_conference_end"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#f8f9fe"
    android:orientation="horizontal" >

    <TextView
        android:id="@+id/new_conference_end_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="end:"
        android:textColor="#000000" />

    <TextView
        android:id="@+id/new_conference_end_value"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:textColor="#000000" />

    <Button
        android:id="@+id/new_conference_end_picker"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="" />
</LinearLayout>

内側のLinearLayoutsの高さをwrap_contentに変更しました

于 2012-04-23T13:04:41.170 に答える
0

重みなしで、layout_width に match_parent を持つ 3 つの LinearLayout があります。

これらの LinearLayout に次の行を追加してみてください

        android:layout_weight="1"
于 2012-04-23T13:01:08.847 に答える