簡體   English   中英

在Android Studio中觸摸EditText時如何隱藏鍵盤

[英]How to hide keyboard when touching on the EditText in Android Studio

我是這個論壇的新手,這是我的第一個問題!

我有一個使用Android Studio 1.1.0在Android上制作計算器的項目。

問題是如何隱藏鍵盤在EditText上(但仍保持光標顯示)

感謝大家 !!!

好吧,您可以使用以下方法: InputMethodManager input = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); input.hideSoftInputFromWindow(EditText1.getWindowToken(), 0); InputMethodManager input = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); input.hideSoftInputFromWindow(EditText1.getWindowToken(), 0); 其中editText1是輸入文本字段的名稱.....它將隱藏鍵盤,您可以使用按鈕在editText中獲取計算器的數字。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM