2012-04-23 8 views
0

同じレイアウトで1つの日付ピッカーと2つの時刻ピッカーを使用しようとしていますが、レイアウトの最初のものだけが表示されています。私は何かが私のレイアウトで絞られる必要がありますが、まだエラーを見つけていないと確信しています。同じレイアウトでDatePickerとTimePickerを使用する

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> 

答えて

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> 

私はちょうど

をwrap_contentするために、内側LinearLayoutsの高さを変更しました
0

あなたが重量なしlayout_widthでmatch_parentと3個のLinearLayoutを持っています。これらのLinearLayoutの

 android:layout_weight="1" 
関連する問題