0

imはtextviewとdatepickerのようなフォームを作成しようとしています: |日付: | datePickerHere | 問題は私が開発者ガイドと同じコードを持っていると思いますが、それは動作しません。それはいつものように終わる: |日付:datePickerHere |datepickerの上にtextviewを配置する方法

相続コード:

<?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"> 

リニアレイアウトを指定しない場合は、水平方向にデフォルト設定されます "アンドロイド:向き"タグ。あなたは望むものを達成するためにそれを垂直に指定する必要があります

関連する問題