文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 电脑基础知识 > android软键盘的用法总结
侵权投诉

android软键盘的用法总结

1.软键盘的显示原理

软键盘其实是一个Dialog。InputMethodService为我们的输入法创建了一个Dialog,并且对某些参数进行了设置,使之能够在底部或者全屏显示。当我们点击输入框时,系统会对当前的主窗口进行调整,以便留出相应的空间来显示该Dialog在底部,或者全屏。

2.活动主窗口调整

Android定义了一个属性windowSoftInputMode, 用它可以让程序控制活动主窗口调整的方式。我们可以在配置文件AndroidManifet.xml中对Activity进行设置。这个属性的设置将会影响两件事情:

1>软键盘的状态——隐藏或显示。

2>活动的主窗口调整——是否减少活动主窗口大小以便腾出空间放软键盘或是否当活动窗口的部分被软键盘覆盖时它的内容的当前焦点是可见的。

故该属性的设置必须是下面列表中的一个值,或一个“state…”值加一个“adjust…”值的组合。在任一组设置多个值,各个值之间用|分开。

"stateUnspecified":The state of the soft keyboard (whether it is hidden or visible) is not specified. The system will choose an appropriate state or rely on the setting in the theme. This is the default setting for the behavior of the soft keyboard. 软键盘的状态(隐藏或可见)没有被指定。系统将选择一个合适的状态或依赖于主题的设置。这个是软件盘行为的默认设置。

"stateUnchanged":The soft keyboard is kept in whatever state it was last in, whether visible or hidden, when the activity comes to the fore. 软键盘被保持上次的状态。

"stateHidden":The soft keyboard is hidden when the user chooses the activity — that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity. 当用户选择该Activity时,软键盘被隐藏。

"stateAlwaysHidden":The soft keyboard is always hidden when the activity's main window has input focus. 软键盘总是被隐藏的。

"stateVisible":The soft keyboard is visible when that's normally appropriate (when the user is navigating forward to the activity's main window). 软键盘是可见的。

"stateAlwaysVisible":The soft keyboard is made visible when the user chooses the activity — that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity. 当用户选择这个Activity时,软键盘是可见的。 "adjustUnspecified":It is unspecified whether the activity's main window resizes to make room for the soft keyboard, or whether the contents of the window pan to make the currentfocus visible on-screen. The system will automatically select one of these modes depending on whether the content of the window has any layout views that can scroll their contents. If there is such a view, the window will be resized, on the assumption that scrolling can make all of the window's contents visible within a smaller area. This is the default setting for the behavior of the main window. 它不被指定是否该Activity主窗口调整大小以便留出软键盘的空间,或是否窗口上的内容得到屏幕上当前的焦点是可见的。系统将自动选择这些模式中一种主要依赖于是否窗口的内容有任何布局视图能够滚动他们的内容。如果有这样的一个视图,这个窗口将调整大小,这样的假设可以使滚动窗口的内容在一个较小的区域中可见的。这个是主窗口默认的行为设置。也就是说,系统自动决定是采用平移模式还是压缩模式,决定因素在于内容是否可以滚动。

"adjustResize":(压缩模式)The activity's main window is always resized to make room for the soft keyboard on screen. 当软键盘弹出时,要对主窗口调整屏幕的大小以便留出软键

第1页

你可能喜欢

  • 使用说明
  • Excel使用技巧大全(超
  • IP基础知识
  • 广州服装批发市场
  • 沟通技巧
  • 房地产培训
  • 电脑使用技巧大全

热门文档

相关文档

  • Android软键盘遮挡的四种解决方案

    Android软键盘遮挡的四种解决方案_计算机软件及应用_... 创意简历模板汇集 推理型题分析与总结文档贡献者 ...2015 Baidu 使用百度前必读

  • 调用Android中的软键盘

    我们在 Android 提供的 EditText 中单击的时候,会自动的弹出软键盘,其实对于软... 儿童房卧室门窗选择 大有讲究2014 Baidu 使用百度前必读 文库协议...

  • 简单几步用wifi将Android手机变身无线鼠标、键盘的方法

    简单几步用wifi将Android手机变身无线鼠标、键盘的方法_计算机软件及应用_IT/...但很多此类软件都存在着使用丌方便的问题,存在着设置 IP 地址等繁琐问题,今天为...

  • android键盘映射

    android键盘映射_计算机硬件及网络_IT/计算机_专业...如果你没有描述任何一个键字符映射,系统将默认使用/... 大学教师个人工作总结 小学英语教学教研工作总结...

  • 关于Android属性EditText中对于软键盘的操作

    关于Android属性EditText中对于软键盘的操作_IT/计算机_专业资料。自己写的... Android EditText使用详... 14页 免费 手动调用android软键盘 14页 免费 ...

  • 手机软键盘的操作界面人机工程

    (提取安装原生Android4.3谷歌中文输入法) 苹果iPhone5(自带iOS7输入法) 诺基亚...在测试的人员中,有六位同学擅长使用双手操作键盘, 巧合的是仅有的两位女同学...

  • android软键盘显示和隐藏

    Android 软键盘显示和隐藏 软键盘的各种显示模式 和... 创意简历模板汇集 推理型题分析与总结文档贡献者 ...2014 Baidu 使用百度前必读

  • Android中常见控件的介绍和使用

    Android中常见控件的介绍和使用_计算机软件及应用_IT/计算机_专业资料。Android...设置软键盘的 Enter 键 设置 IME 动作标签 获取是否默认可编辑 设置文件过长时...

  • 键盘的用法

    AndroidiPhoneiPad 扫描二维码下载 支持Android / iPhone / iPad文档信息举报文档...Windows 基本操作 文件操作命令总结右键菜单中的命令 菜单栏里的各种命令 键盘...

  • Android虚拟机的使用指南

    其他功能基本上和手机上的 Android 系统没有分辨,可以浏览网页,下载应用程序,安装应 用程序,浏览微博,基本功能都非常齐全。 文字输入方面可以直接使用电脑的键盘输入...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email