レイアウトに問題があります。アクティビティの下部にテキストエディットとボタンを1つずつ配置したいと思います。次に、アクティビティのレイアウトのすべての空き領域を埋めるTextViewコンポーネントが必要です。
bigTextコンポーネントに大きなテキストがあるため、ScrollViewを使用する必要があります。
少し質問があります:
わかりません。ScrollViewコンポーネントを配置すると、なぜソフトキーボードが表示されるのですか?しかし、私はスクロールビューなしでこのキーボードを手に入れることはできません!次のように、ソフトキーボードをオフにすると、次のようになります。
getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN );
では、EditTextをどのように使用できますか?
私のレイアウトを手伝ってくれませんか?問題は次のとおりです。ScrollViewを使用すると、すべての電話のディスプレイがいっぱいになります。ScrollViewの下に配置するボタンとEditTextも表示されます(レイアウトの下部が完全に表示されません)。どうすればこれを修正できますか?
そして、それは私の失敗したレイアウトの試みです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/bigText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TextView" />
</ScrollView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search string: " />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:gravity="center_vertical|center_horizontal" >
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Go >>" />
</LinearLayout>
</LinearLayout>