ios 弹出不同的键盘
iOS 提供了10种键盘类型,在开发中,我们可以根据不同的需求,选择不同的键盘样式,例如,当我们只需要输入手机号码时,可以选择纯数字类型的键盘(NumbersAndPunctuation),当我们需要输入网址时,可以选择URL样式的键盘(UIKeyboardTypeURL),其中,默认的键盘样式(UIKeyboardTypeDefault)就是(UIKeyboardTypeNamePhonePad)样式。
我们可以通过输入框的 keyboardType 来设置键盘样式
UITextField.keyboardType = UIKeyboardTypeNamePhonePad;
- 1
1、 UIKeyboardTypeDefault,
// Default type for the current input method.
2、 UIKeyboardTypeASCIICapable,
// Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active
3、 UIKeyboardTypeNumbersAndPunctuation,
// Numbers and assorted punctuation.
4、 UIKeyboardTypeURL,
// A type optimized for URL entry (shows . / .com prominently).
5、 UIKeyboardTypeNumberPad,
// A number pad (0-9). Suitable for PIN entry.
6、 UIKeyboardTypePhonePad,
// A phone pad (1-9, *, 0, #, with letters under the numbers).
7、 UIKeyboardTypeNamePhonePad,
// A type optimized for entering a person's name or phone number.
8、 UIKeyboardTypeEmailAddress,
// A type optimized for multiple email address entry (shows space @ . prominently).
9、 UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1),
// A number pad with a decimal point.
10、 UIKeyboardTypeTwitter NS_ENUM_AVAILABLE_IOS(5_0),
// A type optimized for twitter text entry (easy access to @ #)
11、 UIKeyboardTypeWebSearch NS_ENUM_AVAILABLE_IOS(7_0),
// A default keyboard type with URL-oriented addition (shows space . prominently).
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
下面一图像展示区别
UIKeyboardTypeDefault
UIKeyboardTypeNumbersAndPunctuation
UIKeyboardTypeURL
UIKeyboardTypeNumberPad
UIKeyboardTypePhonePad
UIKeyboardTypeEmailAddress
UIKeyboardTypeDecimalPad
UIKeyboardTypeTwitter
UIKeyboardTypeWebSearch
ios 弹出不同的键盘的更多相关文章
- 点击底部input输入框,弹出的软键盘挡住input(苹果手机使用第三方输入法 )
测试移动端页面的时候,偶然发现点击底部input输入框时,弹出的虚拟键盘偶尔会挡住input输入框. 输入框固定在页面底部,如图所示: input固定底部设计图.png 点击底部input输入框唤 ...
- android 弹出的软键盘遮挡住EditText文本框的解决方案
1.android 弹出的软键盘遮挡住EditText文本框的解决方案: 把Activit对应的布局文件filename.xml文件里的控件用比重设置布局.(例如:android:layout_wei ...
- IOS弹出视图 LewPopupViewController
LewPopupViewController是一款IOS弹出视图软件.iOS 下的弹出视图.支持iPhone/iPad. 软件截图 使用方法 弹出视图 1 2 3 4 5 PopupView *vie ...
- input弹出的手机键盘搜索事件
一.input的搜索框 在input标签里面把type设置为search就可以了.弹出的手机键盘回车键也会变成搜索或者是搜索的图标. <input id="search" ...
- Android - 隐藏EditText弹出的软键盘输入(SoftInput)
隐藏EditText弹出的软键盘输入(SoftInput) 本文地址: http://blog.csdn.net/caroline_wendy 保持界面的整洁, 能够选择在进入界面时, 隐藏EditT ...
- 【小贴士】zepto find元素以及ios弹出键盘可能让你很头疼
前言 在此,我不得不说移动端的兼容问题很多,并且很令人头疼,这不,这个星期又有两个让我逮着了,一个是使用zepto过程中出现的问题,一个是ios虚拟键盘的问题 我这里做一次记录,以免以后忘了,同时希望 ...
- iOS开发 编辑框被系统弹出的软键盘遮挡问题
我们在开发注冊界面的时候,最后几个注冊条件经常easy被系统弹出的键盘遮挡,例如以下图: 能够看见,邮箱条件被遮挡掉了,怎么解决呢?我是通过UITextField的代理加计算偏移量: - (void) ...
- 关闭ios弹出框:“would like to use your current location”
图一: 图二: 使用cordova生成ios项目,首次打开获取用户定位时会弹出两次对话框,关闭图二中对话框方法: document.addEventListener("deviceready ...
- android EditText设置弹出数字输入法键盘
<EditText android:id="@+id/edit_digit_input" android:layout_width="wrap_ ...
随机推荐
- SQL语句/函数汇总
1.CHARINDEX(短字符A,长字符B) 说明:返回A在B的位置,从1开始,若B中不存在A,则为0 例如: SELECT CHARINDEX('aaaa','abaaaacded') ----- ...
- HTML组成与语法
http://blog.csdn.net/niushitang/article/details/8230014 <HTML> <HEAD> <TITLE& ...
- Jenkins安装
直接下载使用Jenkins有两种方式:一种是下载war包安装.另一种是下载.zip进行安装. 一..zip解压安装 1.下载Jenkins:地址http://mirrors.jenkins-ci.or ...
- 20145204&20145212信息安全系统实验二
20145204&20145212信息安全系统实验二 链接
- Java多线程 3 线程同步
在之前,已经学习到了线程的创建和状态控制,但是每个线程之间几乎都没有什么太大的联系.可是有的时候,可能存在多个线程多同一个数据进行操作,这样,可能就会引用各种奇怪的问题.现在就来学习多线程对数据访问的 ...
- C语言创建及解析Json的使用法则
参考原文:http://blog.csdn.net/xukai871105/article/details/33013455 JSON(JavaScriptObject Notation)是一种轻量级 ...
- Oracle操作
1.查询表空间地址: select name from v$datafile; 2.创建表空间: create tablespace yysspace datafile ‘D:\APP\MIAO\OR ...
- mysqldump数据库同步遇到的问题
1.同步数据是遇到 没有 lock database权限,报 " mysqldump: Got error: 1044: Access denied for user 'spider_dat ...
- Java获取某年第一天和最后一天
package com.dada.test; import java.text.SimpleDateFormat; import java.util.Calendar; import java.uti ...
- Debian8升级4.5内核
本文讲述如何升级Debian8的内核到4.5版本 0x01:去linux kernel官网https://www.kernel.org/下载4.5的内核,选择tar.xz格式 0x02:想办法把下载好 ...