justPan没有preventing从覆盖的EditText键

justPan没有preventing从覆盖的EditText键

本文介绍了adjustPan没有preventing从覆盖的EditText键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个pretty的基本的聊天屏幕,显示文本和一个EditText在底部,一个发送按钮的EditText的右边一个ListView。一切都是功能性的,但是当我点击的EditText,虚拟键盘覆盖它。屏幕平移了一点,但还不足以成为键盘上方可见。我已经在我的清单中的adjustPan标签,并也曾尝试adjustResize的标签也没有用。我猜它是与我的布局设置的方式,但老实说,我没有任何线索。请帮帮忙!

I'm trying to create a pretty basic chat screen with a ListView displaying the text and an EditText at the bottom and a "Send" button to the right of the EditText. Everything is functional, but when I click the EditText, the virtual keyboard covers it. The screen pans up a little but not enough to become visible above the keyboard. I've got the "adjustPan" tag in my manifest and have also tried the "adjustResize" tag to no avail. I'm guessing it has something to do with the way my layout is set up, but I honestly have no clue. Please help!

当前布局...

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ListView android:id="@+id/android:list"
    android:layout_height="0dip"
    android:layout_width="fill_parent"
    android:layout_weight="1"
    android:stackFromBottom="true">
</ListView>

<LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <EditText android:id="@+id/sendMessageBox"
        android:focusable="true"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:scrollbars="vertical"
        android:maxLines="4"
        android:text=""
        android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
        android:maxLength="1000"
        android:hint="Type your message..."
        android:imeOptions="actionSend"/>

    <Button android:id="@+id/sendMessageButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:text="Send"/>

</LinearLayout>

推荐答案

做了很多搜索显然这就是我打电话的错误后。如果您使用全屏标签(除去从该活动的状态栏),你没有包装的活性在滚动型不能使用adjustResize。不幸的是我,我用一个ListView这将创造又一个问题。我讨厌它搞乱,并将可能只是放弃该活动的全屏。

After doing a lot of searching apparently it's what I'm calling a bug. If you use the fullscreen tag (to remove the status bar from the activity) you can't use "adjustResize" without wrapping the activity in a ScrollView. Unfortunately for me I'm using a ListView which would create yet another problem. I'm sick of messing with it and will probably just abandon the fullscreen on that activity.

这篇关于adjustPan没有preventing从覆盖的EditText键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 03:51