0

私はAndroidにまったく慣れていません。最初の試みは、LinearLayoutを使用して複数のコントロールを配置することですが、エミュレーター画面はすべてのコントロールを含むほど大きくなく、出力にはすべてのコントロールが表示されず、垂直スクローラーが自動的に表示されません。追加した。それらをすべて表示できるようにするにはどうすればよいですか?

<LinearLayout>
<control_1/>
<control_2/>
///////...
<control_n/>
</LinearLayout>
4

1 に答える 1

1

レイアウトをScrollViewでラップする必要があります。コードは次のようになります。

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <!-- put your controls in here -->

    </LinearLayout>
</ScrollView>
于 2012-10-01T21:34:27.570 に答える