Android Softkeyboard将数值输入edittext非常慢

前端之家收集整理的这篇文章主要介绍了Android Softkeyboard将数值输入edittext非常慢前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我有TableLayout,其中包含多个产品.每行包含代码,描述数量,价格,折扣价值,…..取决于用户输入数量,折扣数量数量.其他一些值也会计算出来.

用户点击editText软键盘时,这个也可以,工作正常

我的问题是当用户按下数字键非常慢以在EditText中显示.

例如我从键盘按3,经过7或8秒后只显示在特定的editText中.如何缩短此时间线…

这是我的产品图片

请有人建议为什么会这样?

像这样的代码

  1. for (int i = initil; i
最佳答案
检查动态tablelayout的此代码

main.xml:

添加TableLayout的内容,请使用以下xml文件

为布局创建sepearate行后,在Java代码添加

  1. contact_table = (TableLayout)findViewById(R.id.contact_table);
  2. LayoutInflater inflater = getLayoutInflater();
  3. for(int i = 0; i < contact_count ; i++) {
  4. LinearLayout row = (LinearLayout)inflater.inflate(R.layout.table_row,contact_table,false);
  5. TextView text = (TextView)row.findViewById(R.id.text);
  6. text.setText(list_data.get(i).summary);
  7. contact_table.addView(row);
  8. }
  9. for(int i=0;i

第二个是循环获取动态创建的表行的单击,在其中添加

  1. msg_title_text.setOnEditorActionListener(new DoneOnEditorActionListener());

相应的动作听众:

  1. class DoneOnEditorActionListener implements OnEditorActionListener {
  2. @Override
  3. public boolean onEditorAction(TextView v,KeyEvent event) {
  4. if (actionId == EditorInfo.IME_ACTION_DONE) {
  5. Log.v("*****************************","Clicked");
  6. return true;
  7. }
  8. return false;
  9. }
  10. }

猜你在找的Android相关文章