久久久久久久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問題)
主站蜘蛛池模板: 男女一区二区三区 | 久久久精品视 | 欧美一区二区三区四区视频 | 成人精品国产一区二区4080 | 欧美一级免费片 | 久操亚洲| 成人黄色网址大全 | 亚洲日日夜夜 | 日日做夜夜爽毛片麻豆 | 亚洲一区视频在线 | 欧美激情亚洲激情 | 91一区 | 欧美成人在线网站 | 美女视频. | 国产精品亚洲片在线播放 | 国产在线精品一区 | a级毛片免费高清视频 | 九九伦理片 | 天天干天天插 | 一区二区三区四区av | 欧美888 | 一级一级毛片免费看 | 日韩中文字幕一区二区 | 中文字幕不卡视频在线观看 | 日韩国产中文字幕 | 国产免费拔擦拔擦8x高清 | 久久国产精品-国产精品 | 亚洲一区精品在线 | 国产一区二区视频免费在线观看 | 亚洲人成人一区二区在线观看 | 国产精品毛片一区二区在线看 | 精品日韩在线 | 欧美精品一区二区在线观看 | 老牛影视av一区二区在线观看 | 毛片视频观看 | 国产精品久久久久久久久久 | av黄色免费| 国产在线91| 精品一区二区三区四区外站 | 欧美一区二区在线播放 | 少妇一区在线观看 |