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

在Android中禁用自定義鍵盤上的一鍵

Disable one key on custom keyboard in Android(在Android中禁用自定義鍵盤上的一鍵)
本文介紹了在Android中禁用自定義鍵盤上的一鍵的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我的 Android 應(yīng)用中有自定義 鍵盤.xml中描述的布局是這樣的

I have custom keyboard in my app for Android. It's layout described in xml like this

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"">
 <Row>
     <Key android:keyLabel="F1" android:keyOutputText="F1"/>
     <Key android:keyLabel="F2" android:keyOutputText="F2"/>
     <Key android:keyLabel="F3" android:keyOutputText="F3"/>
...

所以,我很想知道如何禁用,例如f1"鍵~讓它變灰且不可觸摸.這里有一些類似的問題,但都是關(guān)于默認(rèn)軟知識庫的.

So, i'm insteresting how i can disable, for example 'f1' key ~ make it grey and untouchable. There are some similar questions here, but all about default soft-KB.

我知道我可以像這樣遍歷鍵

I know I can iterate through keys like this

for (Keyboard.Key key : myKeyboard.getKeys())

但它看起來像 Keyboard.Key 類的對象對按鍵外觀的任何變化都無用.

but it's look like objects of Keyboard.Key class are useless for any changes in key's look.

UPD:我沒有找到解決方案.我手動實(shí)現(xiàn)了鍵盤——大的相對布局、常用按鈕和自定義按鈕,一切都很好.順便說一句 - 自定義鍵盤至少更漂亮.只需從 droid 4+ 復(fù)制資源 - 您將在每個(gè)平臺上獲得漂亮的現(xiàn)代透明按鈕和透明布局.

UPD: I did not found solution. I implemented keyboard manually - big relative layout, common buttons and custom buttons and everything fine. By the way - custom keyboard at least more beautiful. Just copy resources from droid 4+ - and you'll get nice modern transparent buttons and transparent layout on every platform.

推薦答案

通常鍵盤只有在編輯時(shí)才可見,因此您可以通過對象捕獲編輯.如果它是一個(gè) editText 框,那么您可以添加一個(gè)偵聽器,然后您可以禁用對編輯文本的任何響應(yīng).我不確定這是否對您有用,但至少您可以捕獲任何不需要的輸入.

Usually the keyboard is only visible if you are editing something, so you can trap the edits via the object. If its an editText box then you can add a listener and then you could disable any response to the edit text. I'm not sure if this is useful to you but at least you can trap any unwanted input.

    // add a keylistener to keep track user input
    editText.setOnKeyListener(new View.OnKeyListener() {
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            // if keydown and "enter" is pressed
            if ((event.getAction() == KeyEvent.ACTION_DOWN)
                    && (keyCode == KeyEvent.KEYCODE_ENTER)) {

                // do some thing or nothing

                return true;

            }

            return false;
        }
    });

這篇關(guān)于在Android中禁用自定義鍵盤上的一鍵的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標(biāo)簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉(zhuǎn)對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點(diǎn)擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設(shè)置為僅接受 Android 中的數(shù)值?)
主站蜘蛛池模板: 欧美一级黄色片免费观看 | 日韩中文视频 | 欧美xxxx黑人又粗又长 | 日韩精品欧美精品 | 丁香婷婷成人 | 免费观看视频www | 亚洲成人精品一区 | 黄色国产 | 性高湖久久久久久久久 | 福利久久| 国产一区二区精品自拍 | 欧美精品三区 | 亚洲精品成人av久久 | 亚洲视频第一页 | 国产精品久久久久久妇女6080 | 青青草视频网 | 日韩精品一区二区三区在线观看 | 99精品欧美一区二区三区 | 欧美日韩不卡合集视频 | 91久久国产综合久久 | 国产精品免费观看视频 | 91网站在线播放 | 日韩成人在线视频 | 97超在线视频 | 天天天堂| www.亚洲一区 | 亚洲成av人片在线观看 | 91 在线| 久草网站 | 日本精品在线播放 | 精品久久久久久久久久久久久久 | 羞羞的视频免费观看 | 久久精品国产一区 | 超碰av免费 | 亚洲最大看片网站 | 成人一区二区三区 | 中文字幕成人 | 成人在线h | 日韩视频在线免费观看 | 夜夜操操操 | 久久久久国产一级毛片高清网站 |