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 弹出不同的键盘的更多相关文章

  1. 点击底部input输入框,弹出的软键盘挡住input(苹果手机使用第三方输入法 )

    测试移动端页面的时候,偶然发现点击底部input输入框时,弹出的虚拟键盘偶尔会挡住input输入框. 输入框固定在页面底部,如图所示:   input固定底部设计图.png 点击底部input输入框唤 ...

  2. android 弹出的软键盘遮挡住EditText文本框的解决方案

    1.android 弹出的软键盘遮挡住EditText文本框的解决方案: 把Activit对应的布局文件filename.xml文件里的控件用比重设置布局.(例如:android:layout_wei ...

  3. IOS弹出视图 LewPopupViewController

    LewPopupViewController是一款IOS弹出视图软件.iOS 下的弹出视图.支持iPhone/iPad. 软件截图 使用方法 弹出视图 1 2 3 4 5 PopupView *vie ...

  4. input弹出的手机键盘搜索事件

    一.input的搜索框    在input标签里面把type设置为search就可以了.弹出的手机键盘回车键也会变成搜索或者是搜索的图标. <input id="search" ...

  5. Android - 隐藏EditText弹出的软键盘输入(SoftInput)

    隐藏EditText弹出的软键盘输入(SoftInput) 本文地址: http://blog.csdn.net/caroline_wendy 保持界面的整洁, 能够选择在进入界面时, 隐藏EditT ...

  6. 【小贴士】zepto find元素以及ios弹出键盘可能让你很头疼

    前言 在此,我不得不说移动端的兼容问题很多,并且很令人头疼,这不,这个星期又有两个让我逮着了,一个是使用zepto过程中出现的问题,一个是ios虚拟键盘的问题 我这里做一次记录,以免以后忘了,同时希望 ...

  7. iOS开发 编辑框被系统弹出的软键盘遮挡问题

    我们在开发注冊界面的时候,最后几个注冊条件经常easy被系统弹出的键盘遮挡,例如以下图: 能够看见,邮箱条件被遮挡掉了,怎么解决呢?我是通过UITextField的代理加计算偏移量: - (void) ...

  8. 关闭ios弹出框:“would like to use your current location”

    图一: 图二: 使用cordova生成ios项目,首次打开获取用户定位时会弹出两次对话框,关闭图二中对话框方法: document.addEventListener("deviceready ...

  9. android EditText设置弹出数字输入法键盘

    <EditText      android:id="@+id/edit_digit_input"      android:layout_width="wrap_ ...

随机推荐

  1. entrar en su zapatilla de deporte en este lugar

    Mientras que yo apareció su campo usando nuestro Nike Glide Wildhorse sólo dos ($ 110) zapatillas de ...

  2. MAC上安装 HLA(High Level Assembly)

    1.安装HLA 最新版的hla汇编器可在这里下载,支持MacOs,Linux,Windows平台 2.安装步骤 将下载好的hla程序包放在Mac根目录下 最重要的一步是设置好环境变量,打开Mac根目录 ...

  3. OperateLoger

    protected void Page_Load(object sender, EventArgs e) { OperateLoger.FunctionInfo =new FunctionInfo { ...

  4. 关于ie版本判断

    //see: http://tanalin.com/en/articles/ie-version-js/ var browser = function(){ var isIE=!!window.Act ...

  5. 3. web前端开发分享-css,js提高篇

    一. css基础知识掌握之后(个人的标准是:弄清块元素与内联元素的区别,弄清float的应用场景,弄清position[pə'zɪʃən] 下五个属性static['stætɪk],relative[ ...

  6. RabbitMQ之window安装步骤

    安装Rabbit MQ Rabbit MQ 是建立在强大的Erlang OTP平台上,因此安装Rabbit MQ的前提是安装Erlang.通过下面两个连接下载安装3.2.3 版本: 下载并安装 Era ...

  7. php-fpm优化方法详解

    php-fpm优化方法 php-fpm存在两种方式,一种是直接开启指定数量的php-fpm进程,不再增加或者减少:另一种则是开始时开启一定数量的php-fpm进程,当请求量变大时,动态的增加php-f ...

  8. 关于MapReduce中自定义分区类(四)

    MapTask类 在MapTask类中找到run函数 if(useNewApi){       runNewMapper(job, splitMetaInfo, umbilical, reporter ...

  9. eclipse导入myeclipse的web项目没法识别问题解决

    (转载)原作者地址:http://www.cnblogs.com/Topless/archive/2011/11/23/2260085.html 1.进入项目目录,找到.project文件,打开. 2 ...

  10. ASP.NET中Ajax的用法

    在ASP.NET中应用Ajax的格式如下: 前台代码(用JQuery库) $.ajax({ type: "POST", async: true, url: "../Aja ...