我有TableLayout,其中包含產品數量。每行包含代碼,描述數量,價格,折扣價值,.....取決於用戶輸入數量,折扣價值,折扣數量&其他一些數值也會計算。Android Softkeyboard將數值輸入edittext非常慢
當EDITTEXT軟鍵盤在用戶點擊後會來這一個還行,做工精細
我的問題是,當用戶按下數字鍵很慢於EditText上顯示。
比如我按3從鍵盤,7或8秒後只顯示它在那個特定的editText.How我可以縮短這個時間線...
這是我的產品形象:
請有人建議爲什麼會發生這種情況?
這樣的代碼:
for (int i = initil; i <end; i++) {
.............
............
final EditText txtQty = new EditText(this);
txtQty.setHeight(1);
txtQty.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 42));
txtQty.setInputType(InputType.TYPE_CLASS_PHONE);
txtQty.setImeOptions(EditorInfo.IME_ACTION_DONE);
txtQty.setImeOptions(EditorInfo.IME_ACTION_NEXT);
txtQty.setSelectAllOnFocus(true);
txtQty.setTextSize(9);
txtQty.setHint("0.0");
// txtQty.setOnEditorActionListener(new DoneOnEditorActionListener());
// txtQty.setHighlightColor(R.color.green);
tr.addView(txtQty);
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(txtQty, InputMethodManager.SHOW_IMPLICIT);
mgr.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_IMPLICIT_ONLY);
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(txtQty.getWindowToken(), 0);
txtQty.setOnEditorActionListener(new OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
Log.i("KeyBoard" ,"Inside the Edit Text");
.............................
} });
檢查並減少tablelayout中的行,...... – viv
你檢查過真實的設備..? –
@Viv目前第一頁包含10條記錄。我不能減少更多,因爲有些客戶有超過400條記錄。所以,如果我們decalre循環的一面,是否有可能獲得外面的行值? (我想不是)。如果我們在外面宣佈它的確定。 – Piraba