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

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

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

問題描述

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

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

解決方案

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

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

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 操作標(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ù)值?)
主站蜘蛛池模板: 国产成人精品一区二区三区四区 | 欧洲亚洲精品久久久久 | 欧美成年人 | 亚洲在线一区二区三区 | 亚洲精品成人在线 | 懂色av一区二区三区在线播放 | 午夜精品一区二区三区在线 | 精品一区二区三区不卡 | 99亚洲精品 | 亚洲激精日韩激精欧美精品 | 狠狠色综合网站久久久久久久 | 免费观看一级毛片 | 一级a性色生活片久久毛片 午夜精品在线观看 | 精品久久ai电影 | 免费观看一级特黄欧美大片 | 国产69精品久久久久777 | 99精品久久99久久久久 | 国产精品视频综合 | www天天操 | 91中文在线观看 | 国产在线资源 | 欧美性生活免费 | 91久久| 亚洲免费观看视频 | 亚洲欧美激情国产综合久久久 | 天天干天天爱天天操 | 成人性视频免费网站 | 精品久久香蕉国产线看观看亚洲 | www.亚洲精品 | 精品国产91乱码一区二区三区 | 久久福利电影 | 国产高清免费在线 | 亚洲一区二区三区国产 | 国产欧美在线一区 | 一区二区激情 | 国产精品色 | 日本三级电影免费 | 日韩第一页 | 欧洲成人免费视频 | 在线一区 | 一区视频|