我已经编写了一个布局 xml,并将 EditText
放在 ImageView
下方和按钮上方。当我点击 EditText
发短信时,按钮出现并显示在 EditText
上。如何解决这个问题?我已经添加到 list 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" />
最佳答案
使用下面的代码在标签内的 AndroidManifest 文件中,如下所示
<activity android:windowSoftInputMode="adjustPan"
android:name=".MainActivity" >
引用这个问题
Android: How do I prevent the soft keyboard from pushing my view up?
关于android - 键盘出现时如何防止滑动布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18931159/