0

메신저는 textview와 datepicker와 같은 양식을 작성하려고합니다. | 날짜 : | | datePickerHere | 문제는 내가 개발자 가이드와 동일한 "코드"라고 생각하지만 작동하지 않습니다. 그것은 항상 다음과 같이 끝납니다 : | 날짜 : datePickerHere |datepicker 상단에 textview를 두는 방법

을 Heres 코드 :

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/scrollView1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

    <LinearLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

     <TextView android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textSize="15sp" 
      android:text="@string/data_label"/> 

     <DatePicker 
      android:id="@+id/data" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" /> 
    </LinearLayout> 
</ScrollView> 

답변

1

변경

<LinearLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

<LinearLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 

선형 레이아웃 당신이 지정하지 않은 경우 수평 방향으로 기본 설정됩니다 "안드로이드 : 방향을" 꼬리표. 원하는 것을 얻기 위해 수직으로 지정해야합니다.

관련 문제