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

如何在焦點更改時停止軟鍵盤自動顯示(OnStart 事

How to stop Soft keyboard showing automatically when focus is changed (OnStart event)(如何在焦點更改時停止軟鍵盤自動顯示(OnStart 事件))
本文介紹了如何在焦點更改時停止軟鍵盤自動顯示(OnStart 事件)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在為使用 Android 2.2 的平板電腦進行開發.

I am developing for a tablet using Android 2.2.

我有一個用于新的可編輯實例的表單.當可編輯時,我想阻止用戶編輯某些字段.我在我的 onStart-事件中管理它,設置 txt.setFocusableInTouchMode(false).這會強制將焦點移到我的表單中的下一個可聚焦的 EditText 上(這很棒),但是在運行時,軟鍵盤會自動出現在具有焦點的 EditText 上.有人知道如何阻止這種情況嗎?

I have a form which I am using for new and editable instances. When editable, I want to stop the user from editing certain fields. I manage this in my onStart-event, setting the txt.setFocusableInTouchMode(false). This forces the focus to the next focusable EditText in my form (which is great), but when running, the soft keyboard automatically appears for the EditText with the focus. Anybody know how to stop this?

這是代碼(在 onStart 事件中調用):

Here's the code (called in the onStart event):

private void PopulateFields(){
    TextView txtTitle = (TextView) this.findViewById(R.id.txtEquipmentEditTitle);
    AutoCompleteTextView txtMake = (AutoCompleteTextView) this.findViewById(R.id.autEquipmentEditMake);
    AutoCompleteTextView txtModel = (AutoCompleteTextView) this.findViewById(R.id.autEquipmentEditModel);
    EditText txtDesc = (EditText) this.findViewById(R.id.txtEquipmentEditDesc);
    TextView txtDeptKey = (TextView) this.findViewById(R.id.txtEquipmentEditDeptKey);
    EditText txtSerial = (EditText) this.findViewById(R.id.txtEquipmentEditSerialNo);
    EditText txtBarCode = (EditText) this.findViewById(R.id.txtEquipmentEditBarCode);

    txtTitle.setText("Edit Equipment");
    txtMake.setText(make);
    txtModel.setText(model);
    txtDesc.setText(desc);
    txtDeptKey.setText(Integer.toString(deptKey));
    txtSerial.setText(serial);
    txtBarCode.setText(barCode);
    txtMake.setEnabled(false);
    txtModel.setEnabled(false);
    txtDesc.setEnabled(false);
    txtMake.setClickable(false);
    txtMake.setFocusableInTouchMode(false);
    txtModel.setFocusableInTouchMode(false);
    txtDesc.setFocusableInTouchMode(false);
    txtMake.setFocusable(false);
    txtModel.setFocusable(false);
    txtDesc.setFocusable(false);
}

推薦答案

也許這會對你有所幫助:

Maybe this will help you:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

當第一次創建或調用活動時,將此方法放在你的activityonCreate()方法中.

Put this method in the onCreate() method of your activity when the activity is first created or called.

這篇關于如何在焦點更改時停止軟鍵盤自動顯示(OnStart 事件)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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問題)
主站蜘蛛池模板: 欧美日一区二区 | 夜夜草天天草 | 欧美高清一区 | 欧美一区二区三区久久精品 | 免费污视频 | 亚州综合在线 | 日韩精品在线免费观看视频 | 日韩免费三级 | 欧美自拍日韩 | 中文字幕亚洲一区二区va在线 | 在线免费视频一区 | 九九综合 | 国产真实精品久久二三区 | 婷婷五月色综合 | 亚洲 欧美 综合 | 欧美日韩一卡二卡 | 久久久久久国产精品免费免费 | 国产精品一区二区免费 | 国产美女自拍视频 | 久久久久久亚洲精品 | 国产一区二区精华 | 成人一区在线观看 | 一区二区久久电影 | 国产高清视频一区 | 亚洲人成人一区二区在线观看 | 9999视频 | 天天操 天天操 | 国色天香综合网 | 中文字幕在线免费观看 | 亚洲国产精品自拍 | 欧美理论 | 日韩免费一区二区 | 国产一区二 | 91xxx在线观看| 成人福利在线观看 | 国产亚洲精品久久情网 | 国产成人一区二区三区 | 欧美成人h版在线观看 | 国产99久久精品一区二区永久免费 | 成人精品鲁一区一区二区 | 欧洲亚洲一区二区三区 |