安卓:多行的EditText和键盘问题 [英] Android: multiline edittext and keyboard problems

查看:189
本文介绍了安卓:多行的EditText和键盘问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的EditText:

i have this edittext:

<EditText android:inputType="textMultiLine|textCapSentences"
    android:layout_width="fill_parent"
android:layout_height="240dp"
android:scrollHorizontally="false"
android:imeOptions="actionNone"
android:minLines="9"
android:scrollbars="vertical"
android:singleLine="false"
    android:gravity="top"
android:layout_gravity="center_vertical|left"
android:nextFocusForward="@+id/costo_dettagli"
android:layout_weight="1"
android:id="@+id/dettagli"
android:textSize="20sp" />

和清单的这一部分:

android:windowSoftInputMode="stateHidden|adjustPan"

问题呢?当键盘显示,这是不言而喻的闪烁光标下面(在换句话说的第一行)和不低于整个的EditText!
在需要有插件下方的键盘

the problem? when the keyboard show up, it goes below the blinking cursor (at the first line in other words) and not below the entire edittext! In need to have the keyboard below the widget.

我所有的布局是在滚动视图,我尝试了所有的Andr​​oid的:windowSoftInputMode

All of my layout is in a scrollview, and i've tried all of the android:windowSoftInputMode

什么是地狱?
我需要帮助,请。

What the hell?? i need help, please.

推荐答案

您可以使用:

android:imeOptions="flagNoExtractUi"

在xml文件

或主要补充一点:

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {

    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;

    // etc.
}

或OnCreate中插入该code:

or in oncreate insert this code:

editText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI)

这篇关于安卓:多行的EditText和键盘问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆