久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android:將鍵盤隱藏在覆蓋的“完成"中EditText

Android: Hiding the keyboard in an overridden quot;Donequot; keypress of EditText(Android:將鍵盤隱藏在覆蓋的“完成中EditText 的按鍵)
本文介紹了Android:將鍵盤隱藏在覆蓋的“完成"中EditText 的按鍵的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我使用了一些 Android 代碼來覆蓋 EditText 字段中的完成"按鈕:

I have used a bit of Android code to override the "Done" button in my EditText field:

   myEditField.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {

                mySubroutine();

                return true;
            }
            return false;
        }
    });

激活該字段會調用鍵盤,然后按完成"會成功評估 mySubroutine().但是,當我按下完成"時,鍵盤不再消失.如何將此默認行為恢復為例程?

Activating the field calls up the keyboard, and pressing "Done" evaluates mySubroutine() successfully. However, the keyboard no longer goes away when I press "Done". How do I restore this default behaviour to the routine?

推薦答案

為什么不呢:

myEditField.setOnEditorActionListener(new TextView.OnEditorActionListener() { 
    @Override 
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { 
        if (actionId == EditorInfo.IME_ACTION_DONE) { 

            mySubroutine(); 
        } 
        return false; 
    } 
}); 

在處理完代碼后返回 false.這可以解釋為無論您的代碼 (mySubroutine()) 做什么,之后它仍將使用默認操作.如果您返回true",則說明您是一個快樂的編碼員,需要完成的所有事情都在您的 mySubroutine() 中發生,并且默認操作不需要執行.

Just return false after you handle your code. This can be interpreted as no matter what your code (mySubroutine()) does it will still use the default action afterwards. If you return "true" you are telling that you are a happy coder and everything that needed to be done has happen in your mySubroutine() and the default action do not need to take action.

這篇關于Android:將鍵盤隱藏在覆蓋的“完成"中EditText 的按鍵的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數的數字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 欧美bondage紧缚视频 | 91色视频在线观看 | 亚洲一区二区在线视频 | 蜜桃视频在线观看免费视频网站www | 欧美日韩一区二区视频在线观看 | 可以免费观看的av片 | 午夜精品久久久久久久久久久久久 | 在线播放第一页 | 中文字幕1区 | 中文字幕1区 | 国产成人精品av | 国产精品欧美一区二区三区不卡 | www.亚洲视频 | 九九热免费在线观看 | 久久综合av | 青青久久 | 国内精品视频在线 | 欧美极品在线播放 | 福利视频一区二区 | 久久久久久免费观看 | 日本视频在线播放 | 欧美精品欧美精品系列 | 久久国产精品一区二区 | 免费天天干 | 久久成人一区 | 欧美精品一二三 | 中文精品视频 | 精品免费av | 亚洲视频在线一区 | www精品 | 久久久免费 | 国产亚洲欧美另类一区二区三区 | 夜夜草 | 国产精品久久久久久中文字 | 一区二区三区日韩精品 | 国产精品国产三级国产播12软件 | 欧美中文在线 | 91亚洲精品国偷拍自产在线观看 | 久久国产激情视频 | 91视频在线网站 | 精品在线一区二区 |