zoukankan      html  css  js  c++  java
  • android 软键盘Enter键图标的设置 android:imeOptions

    android 软键盘Enter键图标的设置

    原文:http://m.blog.csdn.net/blog/huanghr_1/8111518

    软键盘的Enter键默认显示的是“完成”文本,我们知道按Enter建表示前置工作已经准备完毕了,要去什么什么啦。比如,在一个搜索中,我们输入要搜索的文本,然后按Enter表示要去搜索了,但是默认的Enter键显示的是“完成”文本,看着不太合适,不符合搜索的语义,如果能显示“搜索”两个字或者显示一个表示搜索的图标多好。事实证明我们的想法是合理的,Android也为我们提供的这样的功能。通过设置android:imeOptions来改变默认的“完成”文本。这里举几个常用的常量值:

    1. actionUnspecified  未指定,对应常量EditorInfo.IME_ACTION_UNSPECIFIED.效果:
    2. actionNone 没有动作,对应常量EditorInfo.IME_ACTION_NONE 效果:
    3. actionGo 去往,对应常量EditorInfo.IME_ACTION_GO 效果:
    4. actionSearch 搜索,对应常量EditorInfo.IME_ACTION_SEARCH 效果:
    5. actionSend 发送,对应常量EditorInfo.IME_ACTION_SEND 效果:
    6. actionNext 下一个,对应常量EditorInfo.IME_ACTION_NEXT 效果:
    7. actionDone 完成,对应常量EditorInfo.IME_ACTION_DONE 效果:

          原文: ”http://www.cnblogs.com/dynasty/archive/2011/03/24/1994418.html

         android键盘中的enter键是可以用editText的android:imeOptions标签变化的。

         比如见到的网页中输入url的go按钮,比如搜索的时候search图标。

         显示search图标需要设置为android:imeOptions="actionSearch"。

         后来发现仅仅设置这一个属性,search按钮还是出不来,后来增加了一个属性android:inputType="text"将键盘设置为文字输入布局,则键盘中search按钮        正常出现。尝试go按钮,也正常出现了。

         原文: http://www.apkbus.com/android-18721-1-1.html

    补充:转:android 回车键事件编程 http://blog.csdn.net/liuxiit/article/details/6903884 http://fariytale.iteye.com/blog/1233625

    发现两种方式都可以捕捉到编辑框软键盘enter事件:

    1)setOnKeyListener

    2)OnEditorActionListener() //用法有所不同

  • 相关阅读:
    UVa 128 Software CRC
    UVa 11258 String Partition(简单DP)
    POJ 3070 Fibonacci(矩阵乘法logN)
    UVa 10280 Old Wine Into New Bottles(剪枝+完全背包)
    图论笔记第四章 欧拉图与哈密尔顿图(beta.)考点
    图。。珍藏season
    图论及其应用哈密尔顿图(alpha)
    9.保健…todo
    android 移植笔记有感
    unp_exam_要点.doc
  • 原文地址:https://www.cnblogs.com/zyppac/p/3628954.html
Copyright © 2011-2022 走看看