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

Android - 自定義鍵盤按鍵和操作

Android - customized keyboard key and action(Android - 自定義鍵盤按鍵和操作)
本文介紹了Android - 自定義鍵盤按鍵和操作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

如果您擁有 Android 手機,您無疑已經(jīng)注意到在某些應(yīng)用程序中,鍵盤布局如何從標準問題變?yōu)閮H數(shù)字或具有 .com.net 基于文本字段輸入類型(例如電話號碼)的特殊按鈕.所以我有兩個問題:

  1. 如何觸發(fā)此自定義?我懷疑它與 EditText 格式
  2. 有關(guān)
  3. 如果我想添加一些自定義按鈕來注入特定模式,是否可以更進一步?假設(shè)我會有一個 AND 按鈕,按下該按鈕會將所有大寫的AND"添加到文本字段中,并用空格包圍.這可以做到嗎?
  4. 要問的是如何在 onKeyPress 事件中捕獲一些組合鍵,然后用模式填充文本字段 - 我已經(jīng)知道如何做到這一點了.

解決方案

它由 android:inputType XML 屬性(或 setInputType() 方法)控制.

有關(guān)可用選項的信息,請參閱 a>,但我不相信目前有任何方法可以完全自定義鍵盤,但我可能是錯的.

If you own Android phone you are no doubt have noticed how in the certain apps the keyboard layout can change from the standard issue to digits-only or to have .com or .net special buttons based on the text field input type (e.g. phone number). So I have 2 questions:

  1. how to trigger this customization? I suspect it has to do with EditText format
  2. Can this be taken even further if I want to add some custom buttons to inject a specific pattern? Say I would have an AND button which when pressed will add all uppercase " AND " surrounded by spaces to the text field. Can this be done?
  3. What I'm not asking is how to capture some key combination in onKeyPress event and then populate text field with a pattern - I pretty much know how to do that already.

解決方案

It is controlled by the android:inputType XML attribute (or the setInputType() method).

For info on the available options see the pages for the XML attribute or the object's method.

As an example, the following XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <EditText 
        android:text="example text"  
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:inputType="phone" />
</LinearLayout>

will give you this layout:

whereas changing the inputType to textEmailAddress will give you this:

You can customize the "action" button as explained here, but I don't believe there's any way to do full customization of keyboards at this time, but I could be wrong.

這篇關(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 操作標簽的多行 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 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設(shè)置為僅接受 Android 中的數(shù)值?)
主站蜘蛛池模板: 久草免费电影 | 一区二区三区在线看 | 美国黄色一级片 | 欧美午夜精品理论片a级按摩 | 欧美片网站免费 | 天堂色区 | 午夜激情免费 | 天天干在线播放 | 黄色免费在线网址 | 亚洲成人中文字幕 | 黄色一级毛片 | 亚洲在线一区 | 懂色一区二区三区免费观看 | 国产成人小视频 | 精品国产乱码久久久久久88av | 一区二区高清在线观看 | 91免费在线看 | 中文字幕一区在线观看视频 | 成人性生交大片免费看中文带字幕 | 中文字幕av在线播放 | 欧美一级黄色免费看 | 黄色片在线观看网址 | 99精品99| 日本久久久久久 | 91精品国产乱码久久久久久久久 | 国产在线播放av | 一级电影免费看 | 日韩一区二区在线视频 | 欧美夜夜 | 三极网站 | 欧美涩涩网 | 99国产精品一区二区三区 | 欧美精品一区二区三区在线四季 | 成人小视频在线观看 | 日本在线免费看最新的电影 | 成人片免费看 | 国产一区二区久久 | 国产一级淫片a直接免费看 免费a网站 | 日韩在线视频观看 | 福利视频大全 | 欧美在线一区二区三区 |