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

UI鍵盤類型

UIkeyboard type(UI鍵盤類型)
本文介紹了UI鍵盤類型的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我只想使用字母鍵盤,如何限制呢?我使用了以下語句,但它沒有隱藏將鍵盤轉換為數(shù)字的按鈕

I want to use only alphabetic keyboard, how to restrict it? I've used following statement but it doesn't hide the button that converts keyboard in numeric one

tempTextField.keyboardType = UIKeyboardTypeAlphabet;    

推薦答案

恐怕您不能將鍵盤限制為只能輸入字母字符.UITextInputTraits 協(xié)議參考中列出了可用的鍵盤類型,并且在頭文件中提供了更多詳細信息:

I'm affraid you cannot restrict the keyboard to only input alphabetic characters. The available keyboardTypes are listed in the UITextInputTraits protocol reference, and with even more detail in the header file:

typedef enum {
    UIKeyboardTypeDefault,                // Default type for the current input method.
    UIKeyboardTypeASCIICapable,           // Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active
    UIKeyboardTypeNumbersAndPunctuation,  // Numbers and assorted punctuation.
    UIKeyboardTypeURL,                    // A type optimized for URL entry (shows . / .com prominently).
    UIKeyboardTypeNumberPad,              // A number pad (0-9). Suitable for PIN entry.
    UIKeyboardTypePhonePad,               // A phone pad (1-9, *, 0, #, with letters under the numbers).
    UIKeyboardTypeNamePhonePad,           // A type optimized for entering a person's name or phone number.
    UIKeyboardTypeEmailAddress,           // A type optimized for multiple email address entry (shows space @ . prominently).

    UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable, // Deprecated

} UIKeyboardType;

我覺得 SDK 中缺少您想要的東西.我會向 Apple 提交一份錯誤報告,要求使用新的鍵盤類型,就像你提到的那樣.

I feel what you want is missing from the SDK. I would file a bug report with Apple requesting a new keyboard type, like the one you mentioned.

除了提交錯誤報告并等待您的新鍵盤類型在 SDK 中可用之外,您還有什么解決方案?檢查文本字段中的輸入.這可以通過分配 UITextField 的委托屬性,并實現(xiàn) UITextFieldDelegate 方法 textField:shouldChangeCharactersInRange:replacementString: 并僅在替換字符串不包含數(shù)字時返回 YES.

What is the solution for you besides filing a bug report and waiting for your new keyboard type to become available in the SDK? Checking the input in the textfield. This can be done by assigning the delegate property of the UITextField, and implementing the UITextFieldDelegate method textField:shouldChangeCharactersInRange:replacementString: and only return YES if the replacement string does not contain numbers.

HTH

這篇關于UI鍵盤類型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

Find the CGPoint on a UIView rectangle intersected by a straight line at a given angle from the center point(在與中心點成給定角度的直線相交的 UIView 矩形上找到 CGPoint)
Is it possible to reference a variable with a string and an int?(是否可以使用字符串和 int 引用變量?)
Is there a native YAML library for iPhone?(是否有適用于 iPhone 的本機 YAML 庫?)
View aligned to top of keyboard appears in wrong place in iOS 9 Shortcut Bar only mode(在 iOS 9 Shortcut Bar only 模式下,與鍵盤頂部對齊的視圖出現(xiàn)在錯誤的位置)
Disable speech to text button (Micro phone) on soft input keyboard in android programmatically(以編程方式在android中的軟輸入鍵盤上禁用語音到文本按鈕(麥克風))
Android - customized keyboard key and action(Android - 自定義鍵盤按鍵和操作)
主站蜘蛛池模板: 一区二区三区四区免费观看 | 亚洲成人精品久久 | 欧美日韩在线成人 | 蜜桃av一区二区三区 | 亚洲国产一区二区三区, | 欧美精品一区二区三区在线播放 | 午夜激情免费视频 | 国产一级黄色网 | 超碰97免费在线 | 最新免费黄色网址 | 欧美成人一级视频 | 狠狠做深爱婷婷综合一区 | 亚洲区中文字幕 | 成人二区 | 亚洲欧美在线一区 | 久久久久久国产精品免费免费狐狸 | 国产欧美一区二区三区另类精品 | 国产精品一区二区久久精品爱微奶 | 欧美aaaa视频 | 成人深夜福利网站 | 国产一区在线免费 | 欧美国产中文 | 91精品久久久久 | 欧美一区二区三区四区五区无卡码 | 日韩中文字幕在线 | 超碰激情| 亚洲精品美女 | 91 在线| 蜜月aⅴ免费一区二区三区 99re在线视频 | 国产成人99久久亚洲综合精品 | 农夫在线精品视频免费观看 | 国产日韩一区二区三免费高清 | 亚洲第一色av | 国产精品久久精品 | 欧美一级淫片免费视频黄 | 北条麻妃99精品青青久久 | 久久国产综合 | 天堂视频免费 | 亚洲欧美日本在线 | 精品欧美一区二区三区久久久 | 欧美综合久久久 |