EditText文字輸入框使用完畢自動掩藏輸入法

2021-08-26 12:12:46 字數 637 閱讀 4802

很多時候edittext文字輸入框在輸入資訊完成操作之後後,我們希望能夠自動收縮掩藏起虛擬鍵盤,以方便處理其他業務邏輯。

比喻本文中edittext文字在輸入商品編號完成商品檢索之後,需要自動掩藏虛擬鍵盤,不要遮擋其他頁面操作資訊,當下次再檢索商品資訊時,再自動彈出虛擬鍵盤完成輸入。

看上圖效果,晚上輸入操作之後,自動掩藏了輸入法,下次使用時再開啟。

關鍵**如下:

edittext etxt_index_queryproduct = findviewbyid(r.id.etxt_index_queryproduct);
/**

* 查詢商品資訊

* author:william(徐威)

* create time:2018-08-29

*/private void searchproduct()

} else

} catch (exception ex)

}

Android 輸入框控制項EditText

android selectallonfocus true 選擇所有對焦點 android inputtype numberpassword 只能接收數字密碼 android inputtype number 數值輸入框 android inputtype date 日期輸入框 android in...

測試文字輸入框

在 web測試中,經常會碰到很多表單輸入框,大體有兩種,一種是數值型文字框,一種是字元型的普通文字輸入框。針對普通的文字輸入框,通常要檢查以下幾點 1 輸入中英文空格 2 輸入超長字元 3 輸入字串中間含空格 4 輸入首尾空格 5 輸入特殊字元 6 輸入 html 格式語言 7 輸入特殊字串 nul...

EditText之有刪除按鈕的輸入框

public class cuseditview extends edittext右側的刪除按鈕 private drawable mdeletedrawable private context mcontext public cuseditview context context public c...