2011-06-26 57 views
2

需要一些幫助才能在EditText中啓用多行而不允許softkeyboard打開Android:在MultiLine中禁用SoftKeyboard EditText

我不使用android的本地軟鍵盤。我有自己的「軟鍵盤」作爲活動內的視圖。

我已經嘗試了這些解決方案,但他們沒有工作:

回答

0

此解決方案安好ndroid 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; 
    } 
}