zoukankan      html  css  js  c++  java
  • 使用imeOptions

    Android的软键盘右下角有Action按钮,如下图的“上一步”

    在EditText中有 android:imeOptions选项,它包括完成按钮“actionDone”,发送按钮“actionSend”等动作。

    如何使用android:imeOptions呢?让EditText实现setOnEditorActionListener,在onEditAction方法中actionId就对应我们设置的imeOptions。

    private TextView.OnEditorActionListener mWriteListener =
            new TextView.OnEditorActionListener() {
            public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
               
                if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
                 
                }
              
                return true;
            }
        };

    KeyEvent.ACTION_UP表示按键松开。

    KeyEvent.ACTION_DOWN 表示按键按下。

  • 相关阅读:
    后台性能测试不可不知的二三事
    linux下操作mysql
    loadrunner scripts
    反射
    java 读取json
    java 多线程
    python_day11
    python爬虫
    python_day10
    python_day9
  • 原文地址:https://www.cnblogs.com/l2rf/p/4956726.html
Copyright © 2011-2022 走看看