ソフトウェアキーボードはAndroidの背景画像のサイズを変更します 質問する

ソフトウェアキーボードはAndroidの背景画像のサイズを変更します 質問する

ソフトウェア キーボードが表示されるたびに、背景画像のサイズが変更されます。以下のスクリーンショットを参照してください。

ご覧のとおり、背景が圧縮されています。背景のサイズが変わる理由を説明できる人はいますか?

私のレイアウトは次のとおりです。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/page_bg"
    android:isScrollContainer="false"
>
    <LinearLayout android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
    >
        <EditText android:id="@+id/CatName"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:inputType="textCapSentences"
            android:lines="1"
        />
        <Button android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/save"
            android:onClick="saveCat"
        />
    </LinearLayout>
    <ImageButton
        android:id="@+id/add_totalk"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:background="@null"
        android:src="@drawable/add_small"
        android:scaleType="center"
        android:onClick="createToTalk"
        android:layout_marginTop="5dp"
    />
</LinearLayout>

ベストアンサー1

OK、私はそれを使用して修正しました

android:windowSoftInputMode="stateVisible|adjustPan"

<Activity >ファイル内のタグ内のエントリmanifest。Activity 内に ScrollView があることが原因だと思います。

おすすめ記事