键盘出现时如何防止滑动布局

emr*_*rka 2 android android-layout

我写了一个布局 xml 并放在按钮的EditText下方ImageView和上方。当我点击EditText发短信时,按钮出现并显示在。EditText如何解决这个问题?我已经添加到 manifest android:windowSoftInputMode="adjustPan"。它仍然无法正常工作。这是我的布局;

<EditText
    android:id="@+id/editTextGunlukIcerik"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/imageView"
    android:layout_below="@+id/imageView"
    android:layout_marginTop="68dp"
    android:ems="10"
    android:maxLines="7"
    android:overScrollMode="always"
    android:scrollHorizontally="false"
    android:scrollbarAlwaysDrawVerticalTrack="true"
    android:scrollbarStyle="insideInset"
    android:scrollbars="vertical" >

    <requestFocus />
</EditText>

<TextView
    android:id="@+id/textViewTarih"
    android:layout_width="fill_parent"
    android:layout_height="15dp"
    android:textStyle="normal|italic"
    android:textAlignment="center"
    android:layout_alignLeft="@+id/editTextGunlukIcerik"
    android:layout_below="@+id/imageView"
    android:layout_marginTop="36dp"/>

<Button
    android:id="@+id/buttonGunlukKaydet"
    android:windowSoftInputMode="adjustResize"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="17dp"
    android:text="Kaydet" />
Run Code Online (Sandbox Code Playgroud)

Kai*_*war 5

将下面的代码用于标签内的 AndroidManifest 文件,如下所示

 <activity android:windowSoftInputMode="adjustPan" 
           android:name=".MainActivity" >
Run Code Online (Sandbox Code Playgroud)

参考这个问题

Android:如何防止软键盘将我的视图向上推?