2012-04-23 4 views
0

동일한 레이아웃에서 하나의 날짜 선택 도구와 두 개의 시간 선택 도구를 사용하려고하지만 레이아웃의 첫 번째 선택 도구 만 표시하려고합니다. 무언가는 내 레이아웃으로 짜내 야하지만 아직 오류를 발견하지 못했습니다.동일한 레이아웃에서 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 세의 LinearLayout 있습니다. 이들의 LinearLayout의

 android:layout_weight="1" 
관련 문제