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

在android中單擊edittext時如何顯示自定義鍵盤

How to display custom keyboard when clicking on edittext in android(在android中單擊edittext時如何顯示自定義鍵盤)
本文介紹了在android中單擊edittext時如何顯示自定義鍵盤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我的應用程序中有一個自定義鍵盤.問題是單擊edittext時如何播放此鍵盤.我使用setonfocuschangre偵聽器,現在更改edittext焦點時會出現custon keyboaed.但是我想在單擊edittext時顯示此鍵盤..一個我忘記的信息將edittext放在片段內.

I have a custom keyboard in my application. question is How to didplay this keyboard when click on the edittext.I an using setonfocuschangre listener ,now the custon keyboaed appears when the edittext focus is changed.but i want to show this keyboard whenever i click on the edittext..one info I forget to put here the edittext is within the fragment.

推薦答案

我使用鍵盤標簽在我的應用程序中創建了一個自定義鍵盤.我在屏幕上的 RelativeLayout 中添加了這個鍵盤.

I created a Custom Keyboard in my application using Keyboard tag. I am adding this keyboard in a RelativeLayout on my screen like.

private void createCustomKeyboard() {
  Keyboard customKeyboard = new Keyboard(getActivity(), R.layout.keyboard);
  CustomKeyboard mCustomKeyboard = new CustomKeyboard(getActivity(), this);
  mCustomKeyboard.setKeyboard(customKeyboard);
  RelativeLayout relLayKeyboard.addView(mCustomKeyboard);  
} 

如果你想在一個或多個 EditText 上使用這個 CustomKeyboard,那么你必須使用下面的代碼:

If you want to use this CustomKeyboard on one or more than one EditText then you have to use below code :

EditText edtxtName = (EditText) v.findViewById(R.id.edtName);
RelativeLayout relLayKeyboard = (RelativeLayout)findViewById(R.id.relLay_keyboard);
edtxtName.setOnTouchListener(exitSoftKeyBoard);

private final OnTouchListener exitSoftKeyBoard = new OnTouchListener() {

@Override
public boolean onTouch(View v, MotionEvent event) {
    InputMethodManager imm = (InputMethodManager) getActivity().getApplicationContext().getSystemService(
            android.content.Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    if(v.equals(edtxtName)){
        edtxtName.requestFocus();
        relLayKeyboard.setVisibility(View.VISIBLE);
    } 
    return true;
  }
};

這篇關于在android中單擊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問題)
主站蜘蛛池模板: 一级黄色片美国 | 国产成人综合在线 | 波多野结衣中文字幕一区二区三区 | 国产蜜臀97一区二区三区 | 中文字幕第5页 | 91福利网| 日韩精品一区二区三区在线观看 | 国产精品s色 | 黄色av观看 | 欧美国产日韩一区二区三区 | 久久99视频 | 福利视频一区二区 | 一区二区三区国产视频 | 国产激情一区二区三区 | 蜜桃av鲁一鲁一鲁一鲁 | 一区二区精品电影 | 中文字幕精品一区二区三区精品 | 国产东北一级毛片 | 成人中文字幕在线观看 | 色婷婷九月 | 在线第一页 | 免费在线观看黄色av | 国产在线不卡 | 日韩精品一区二区三区中文在线 | 久久久片 | 亚洲精品视频导航 | 台湾佬成人网 | 亚洲成人一区二区在线 | 欧美精品99 | 人人性人人性碰国产 | 欧美大片黄 | 国产精品夜夜夜一区二区三区尤 | 青青草原综合久久大伊人精品 | 久久综合国产 | 色婷婷久久久久swag精品 | 999久久久免费精品国产 | 亚洲国产成人久久久 | 亚洲欧洲一区 | 日韩欧美在线视频播放 | 最新中文在线视频 | 中文字幕第十一页 |