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

editText 沒有失去焦點

editText is not losing focus(editText 沒有失去焦點)
本文介紹了editText 沒有失去焦點的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

當我點擊它時,editText 在我的應用程序中沒有失去焦點,它一直有橙色邊框和那個黑線光標..我根據editText周圍的這個做了一個LinearLayout:停止 EditText 在 Activity 啟動時獲得焦點所以它不會專注于應用程序的啟動..

the editText is not losing focus in my app when I click out of it, it has the orange border all time and that black line cursor.. I did this a LinearLayout according to this surrounding the editText: Stop EditText from gaining focus at Activity startup so it doesn't get focus on start of the app..

這是我的代碼:

final EditText et = (EditText)findViewById(R.id.EditText01);

final InputMethodManager imm = (InputMethodManager) getSystemService(
   INPUT_METHOD_SERVICE);

et.setOnClickListener(new View.OnClickListener() {
   public void onClick(View v) {
      imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT);
   }
});

et.setOnFocusChangeListener(new View.OnFocusChangeListener() {
   public void onFocusChange(View v, boolean hasfocus) {
      if(hasfocus) {
         imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT);
      } else {
         imm.hideSoftInputFromWindow(et.getWindowToken(), 0);
      }
   }
});

但是,當我點擊editText之外的任何地方時,它似乎并沒有調用onFocusChange!

But, it doesn't seem to be calling the onFocusChange when I click anywhere outside the editText!

推薦答案

很簡單.您可以將以下內容放入 LinearLayout 或其他任何內容中:

It's simple. You can put the following in LinearLayout or any other else:

android:focusableInTouchMode="true"

這篇關于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問題)
主站蜘蛛池模板: 国产激情91久久精品导航 | 中文字幕第90页 | 国产成人啪免费观看软件 | 国产精品久久 | 天天艹逼网 | 成人网址在线观看 | 视频精品一区二区三区 | 国产无套一区二区三区久久 | 荷兰欧美一级毛片 | 中文字幕在线第一页 | 亚洲视频在线观看一区二区三区 | 欧美中文字幕一区 | 亚洲三级在线观看 | 国产在线精品一区二区三区 | 天堂色 | 欧美不卡一区二区三区 | 国产在线中文 | 久久高清亚洲 | 精品国产一区二区三区性色av | 久久久久一区二区三区 | 人人人干| av日日操 | 国产美女在线观看 | 秋霞国产| 一区二区视频免费观看 | 天堂国产 | 99久久久无码国产精品 | 国产亚洲一区精品 | 成人免费一区二区三区视频网站 | 久久久久久久久久久久亚洲 | 欧美人人 | 亚洲一区二区中文字幕 | 国产精品精品视频一区二区三区 | 亚洲精品一区二三区不卡 | 狠狠av| 91视频精选 | 久久久av | 91视频精选 | 成人免费看电影 | 成人欧美一区二区三区白人 | 久久国产精品视频 |