Клавиатура в adjustResize и ScrollView - не работает!

Интерфейс, диалоги, темы, стили, меню
Ответить
JDev
Сообщения: 88
Зарегистрирован: 05 авг 2012, 19:42

Клавиатура в adjustResize и ScrollView - не работает!

Сообщение JDev » 31 июл 2016, 12:45

Здравствуйте, подскажите пожалуйста, почему у меня не срабатывает следующее.

Есть у меня в лейауте, EditText. Когда выскакивает клавиатура, все сжимается, как положено, но сжимается все содержимое, а скролл там где нужно не появляется..
А вообще, в идеале - можно так сделать, чтоб при adjustResize нижний слой (emptyBottomLay) не показывался, а на экране оставалось только то что в ScrollView ну и соответственно не сжималось, а прокручивалось в сжатом ScrollView?

Благодарю за подсказки.. А то примеров много, я уже несколько часов пробую, и что-то не так... Не вижу..

Код: Выделить всё

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/app_background_gradient">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.87"
        android:fillViewport="true"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/topLay"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="0.2"
                android:orientation="horizontal">

            </LinearLayout>

            <LinearLayout
                android:id="@+id/editTextLay"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_centerHorizontal="true"
                android:layout_weight="0.15"
                android:gravity="center"
                android:orientation="horizontal"
                android:padding="5dp">

                <EditText
                    android:id="@+id/trEt"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionDone"
                    android:inputType="textMultiLine"
                    android:singleLine="true" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/middleLay"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_centerHorizontal="true"
                android:layout_weight="0.05"
                android:gravity="center"
                android:orientation="horizontal"
                android:padding="5dp">

                <TextView
                    android:id="@+id/wdTv"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_centerHorizontal="true"
                    android:gravity="center"
                    android:maxLines="50"
                    android:scrollbars="vertical"
                    android:text=""
                    android:textSize="20dp"
                    android:textStyle="bold"
                    android:typeface="monospace"
                    android:visibility="invisible"></TextView>
            </LinearLayout>

            <LinearLayout
                android:id="@+id/controlLayout"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="0.5"
                android:gravity="top"
                android:orientation="vertical"
                android:padding="5dp">

                <Button
                    android:id="@+id/answerBtn"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="top"
                    android:background="@drawable/border_dotted_item_in_black"
                    android:enabled="false"
                    android:text="@string/label_show_answer" />

            </LinearLayout>
        </LinearLayout>
    </ScrollView>

    <LinearLayout
        android:id="@+id/emptyBottomLay"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.13"
        android:orientation="vertical"></LinearLayout>

</RelativeLayout>


Ответить