Keyboardtype Keyboard and app how many keyboard styles and Uitextview and uitextfield some knowledge

Source: Internet
Author: User


Keyboardtype Keyboard and app how many keyboard styles and Uitextview and uitextfield some knowledge


Preface:

The Uitextinputtraits protocol classes are implemented in the Uitextview and Uitextfield classes, and the various properties of the keyboard are defined in the Uitextinputtraits protocol class.

Body:

We can pass the Keyboardtype attribute, which is applicable according to the situation.

Types of keyboards
Uikeyboardtype
Type of keyboard display
    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//   //Current keyboard//    _viewfield.keyboardtype= uikeyboardappearancedefault;//    [Self.view addsubview:_viewfield];//    
    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //keyboard for Alphabet input//    _viewfield.keyboardtype= uikeyboardtypeasciicapable;//    [Self.view addsubview:_viewfield];//    //    

    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //url input keyboard//    _viewfield.keyboardtype= uikeyboardtypeurl;//    [Self.view addsubview:_viewfield];//////        

/
    //    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];///    /Digital input keypad//    _viewfield.keyboardtype= uikeyboardtypenumberpad;//    [Self.view addsubview:_viewfield];//    ////       



    //    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //Phone number input keyboard//    _viewfield.keyboardtype= uikeyboardtypephonepad;//    [Self.view addsubview:_viewfield];//    ////       

////    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //email address input keypad//    _viewfield.keyboardtype= uikeyboardtypeemailaddress;//    [Self.view addsubview:_viewfield];//    ////    //    

    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //With smiley face, emoji keyboard//    _viewfield.keyboardtype= uikeyboardframeenduserinfokey;//    [Self.view addsubview:_viewfield];//    

    //    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //keyboard with numerals and letters, punctuation//    _viewfield.keyboardtype= uikeyboardappearancealert;//    [Self.view addsubview:_viewfield];//    ////    

    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //keypad with digital/punctuation//    _viewfield.keyboardtype= uikeyboardappearancelight;//    [Self.view addsubview:_viewfield];//    //      

    _viewfield=[[uitextview alloc]init];//    _viewfield.frame=self.view.frame;//    _ Viewfield.backgroundcolor=[uicolor greencolor];//    //keypad with digital/punctuation//    _viewfield.keyboardtype= uikeyboardappearancelight;//    [Self.view addsubview:_viewfield];//    //      




Second: What are the kinds of return keys (Chinese line wrapping) in the lower right corner of our keyboard?


type of Return key
Uireturnkeytype Effect
_viewfield.returnkeytype=uireturnkeydefault;

_viewfield.returnkeytype=uireturnkeydone;

_viewfield.returnkeytype=uireturnkeyemergencycall;

_viewfield.returnkeytype=uireturnkeygo;

_viewfield.returnkeytype=uireturnkeygoogle;

_viewfield.returnkeytype=uireturnkeyjoin;

_viewfield.returnkeytype=uireturnkeynext;

_viewfield.returnkeytype=uireturnkeyroute;

_viewfield.returnkeytype=uireturnkeysearch;

_viewfield.returnkeytype=uireturnkeysend;

_viewfield.returnkeytype=uireturnkeyyahoo;



The third step: the auto-invalid function of Return key is

After you set the Enablesreturnkeyautomatically property of Uitextview to Yes, you can make the return key automatically invalid if the text content is empty. For example: The Done key, as long as no characters are entered

, the user will not be able to touch the done button effectively.






Friendship Express:



Automatic invalid function for SHIFT key


Preface:

When we write capital letters, we need to press SHIFT and the letter, very troublesome ... Now there's a way to do the following "" "


Constants can be set in the Autocapitalizationtype property
Uitextautocapitalizationtype Shift-Key response
Uitextautocapitalizationtypewords Shift is valid at the beginning of a word
Uitextautocapitalizationtypesentences
In the case of the beginning of the article, shift is valid
Uitextautocapitalizationtypeallcharacters Works in any situation
Uitextautocapitalizationtypenone SHITF not automatically effective


Second Pass:


Automatic correction


Automatic correction is provided in Uitextview and Uitextfield, and corrective and non-corrective (yes/no) can be controlled by Autocorrectiontype properties. Yes for correction ....




Third Pass:

input of the password


Features that have password visibility and invisibility are available in Uitextfield. Set the Securetextentry property to Yes after the function is turned on ...










Keyboardtype Keyboard and app how many keyboard styles and Uitextview and uitextfield some knowledge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.