相关疑难解决方法(0)

Android:无法想象如何使用setImeActionLabel

我想要做的是更改虚拟键盘中显示的默认"完成"标签.这是我没有运气的尝试:

mSearchInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
mSearchInput.setImeActionLabel(getString(R.string.search_action_label), EditorInfo.IME_ACTION_DONE);
Run Code Online (Sandbox Code Playgroud)

能干,但是,处理该按钮的点击,这一点:

mSearchInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            performSearch();
            return true;
        }
        return false;
    }
});
Run Code Online (Sandbox Code Playgroud)

我对如何在此刻更改该按钮上的标签毫无头绪.

java android android-edittext

26
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

android-edittext ×1

java ×1