需要一些帮助才能在EditText 中启用多行,而不必通过软键盘打开。
我不使用android的原生软键盘。我有自己的“软键盘”作为内部活动的一个视图。
我尝试过这些解决方案,但它们没有奏效:
发布于 2012-04-23 18:44:06
这个解决方案适用于Android 2,但对某些Android 4手机却不起作用(我也不知道为什么):
<EditTextExtension
a:editable="false"
a:singleLine="false"/>类EdiTextExtension应该重写onCheckIsTextEditor()方法:
@Override
public boolean onCheckIsTextEditor() {
if ( Build.VERSION.SDK_INT >= 11 ) {
// resulting false for Android >= 11 will hide cursor
// NOTE: this code works fine only with SOME devices and not all (WHY?)
return true;
} else {
return false;
}
}https://stackoverflow.com/questions/6486903
复制相似问题