0

レイアウト画像

私のアプリケーションには、いくつかのコントロールを持つ左右のバーがあり、それらのバーは修正する必要があります。本文には、ユーザーによる入力情報の編集テキスト フィールドがあります。ソフト キーボードが表示されると (カスタム)、適切な編集テキストがキーボードの上に表示されます。

マニフェストに次のようなオプションがあることは知ってandroid:windowSoftInputModeいますが、問題が見つかりません。許容できないキーボード (バー付き) の上にレイアウトを移動したり、移動せずにレイアウトを維持したりすることができるため、キーボードによって隠されているテキスト編集を編集できます。

この問題について教えてください。

私のレイアウトサンプル:

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

    <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginLeft="100.0dip"
            android:layout_marginRight="200.0dip"
            android:orientation="vertical">

        <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginLeft="30dip"
                android:layout_marginRight="30dip">

            <TextView
                    android:id="@+id/createuser_textView_logo"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:text="@string/createuser_text_logo"
                    style="@style/TextActivityLogo"/>


            <ScrollView
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_below="@+id/createuser_textView_logo"
                    android:layout_marginBottom="20dp">

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

                    <TextView
                            android:id="@+id/createuser_textView_text"
                            android:layout_alignParentLeft="true"
                            android:text="@string/createuser_text_text"
                            style="@style/TextActivityText"/>

                    <com.mycompany.myapp.views.MyEditText
                            android:id="@+id/createuser_editText_username"
                            android:layout_alignParentLeft="true"
                            android:layout_alignParentRight="true"
                            android:layout_below="@+id/createuser_textView_text"
                            android:hint="@string/createuser_edit_username"
                            android:nextFocusDown="@+id/createuser_editText_password"
                            style="@style/MyEditText"/>

                    <com.mycompany.myapp.views.MyEditText
                            android:id="@+id/createuser_editText_password"
                            android:layout_alignParentLeft="true"
                            android:layout_alignParentRight="true"
                            android:layout_below="@+id/createuser_editText_username"
                            android:hint="@string/createuser_edit_password"
                            android:inputType="textPassword"
                            android:nextFocusUp="@+id/createuser_editText_username"
                            android:nextFocusDown="@+id/createuser_editText_firstname"
                            style="@style/MyEditText"/>

                    <com.mycompany.myapp.views.MyEditText
                            android:id="@+id/createuser_editText_firstname"
                            android:layout_alignParentLeft="true"
                            android:layout_alignParentRight="true"
                            android:layout_below="@+id/createuser_editText_password"
                            android:hint="@string/createuser_edit_firstname"
                            android:nextFocusUp="@+id/createuser_editText_password"
                            android:nextFocusDown="@+id/createuser_editText_lastname"
                            style="@style/MyEditText"/>

                    <com.mycompany.myapp.views.MyEditText
                            android:id="@+id/createuser_editText_lastname"
                            android:layout_alignParentLeft="true"
                            android:layout_alignParentRight="true"
                            android:layout_below="@+id/createuser_editText_firstname"
                            android:hint="@string/createuser_edit_lastname"
                            android:nextFocusUp="@+id/createuser_editText_firstname"
                            android:nextFocusDown="@+id/createuser_editText_email"
                            style="@style/MyEditText"/>


                    <com.mycompany.myapp.views.MyEditText
                            android:id="@+id/createuser_editText_email"
                            android:layout_alignParentLeft="true"
                            android:layout_alignParentRight="true"
                            android:layout_below="@+id/createuser_editText_lastname"
                            android:hint="@string/createuser_edit_email"
                            android:imeOptions="actionDone|flagNoExtractUi"
                            android:inputType="textWebEmailAddress"
                            android:nextFocusUp="@+id/createuser_editText_lastname"
                            style="@style/MyEditText"/>

                </RelativeLayout>
            </ScrollView>
        </RelativeLayout>
    </RelativeLayout>

    <com.mycompany.myapp.views.LeftNavigationBar
            android:id="@+id/left_nav_bar"
            android:layout_width="100dp"
            android:layout_height="wrap_content"/>

    <com.mycompany.myapp.views.RightNavigationBar
            android:id="@+id/right_nav_bar"
            android:layout_width="200dip"
            android:layout_height="fill_parent"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"/>

</RelativeLayout>
4

1 に答える 1

2

キーボードで画面上のいくつかのレイアウトを変更し、他のレイアウトはそのままにしておく必要があるようです。これが通常の動作で可能かどうかはわかりません。

ただし、ソフト キーボードが表示されたときに何らかの方法でイベントを取得できる場合は、リストビューのスクロール位置を変更して目的のテキストビューを表示できます。一番上までスクロールしてもキーボードがレイアウトをブロックしている場合は、リストビューにマージンを追加するだけです。

于 2013-07-15T22:04:01.737 に答える