Как установить раскладку над программной клавиатурой

У меня есть следующий макет xml

<ScrollView
    android:id="@+id/transfer_scroller"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/blue_500"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:orientation="vertical" ></LinearLayout>
        <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:orientation="vertical" ></LinearLayout>
        <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <EditText
                        android:id="@+id/tv_money_type"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                      android:layout_gravity="center_horizontal|center_vertical"
                        android:textColor="@color/gray_400">
                    </EditText>
                    <Button
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:background="@android:color/transparent"
                        android:text="@string/btn_transfer_select_receiver"
                        android:textColor="@color/blue_500" />

        </LinearLayout>          
</LinearLayout>

когда я прокручиваю вниз и нажимаю editText - откройте softKeyBoard и измените размер макета, чтобы я мог видеть только поле editText, и мне нужно, чтобы весь последний LinearLayout был над клавиатурой, чтобы пользователь мог видеть btn под editText.

вот моя активность в манифесте:

<activity
            android:name=".acitivity.Activity"
            android:label="@string/title_activity"
            android:theme="@style/AppTheme.NoActionBar"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateVisible">
        </activity>

я пытался установить android:windowSoftInputMode="adjustResize", но похоже, что это не работает с scrollView...

есть идеи, как это исправить?


person Stan Malcolm    schedule 02.11.2015    source источник
comment
вы имеете в виду основной LinearLayout внутри scrollView? или прокрутка?   -  person Stan Malcolm    schedule 02.11.2015
comment
Вы должны установить это в scrollview   -  person Lakhwinder Singh    schedule 02.11.2015


Ответы (1)


1) В AndroidManifest.xml используйте:

            android:windowSoftInputMode="adjustResize"

2) Проверьте это...

3) Или вы можете попробовать это:

            android:windowSoftInputMode="adjustResize|stateVisible"

Если вам нужно открыть KeyBoard изначально.

Надеюсь, это поможет вам.

person Rahim Rahimov    schedule 02.11.2015