본문 바로가기
프로그래밍 놀이터/iOS

[iOS] keyboard type 바꾸기

by 돼지왕 왕돼지 2016. 9. 19.
반응형

 [iOS] keyboard type 바꾸기


constant, enum, Example, IB, Interface builder, IOS, keyboard type, NSInteger, NS_ENUM, sample, setKeyboardType, typedef, UIKeyboardType, UIKeyboardTypeASCIICapable, UIKeyboardTypeASCIICapableNumberPad, UIKeyboardTypeDecimalPad, UIKeyboardTypeDefault, UIKeyboardTypeEmailAddress, UIKeyboardTypeNamePhonePad, UIKeyboardTypeNumberPad, UIKeyboardTypeNumbersAndPunctuation, UIKeyboardTypePhonePad, UIKeyboardTypeTwitter, UIKeyboardTypeURL, UIKeyboardTypeWebSearch, UITextField, UITextView, xcode, [iOS] keyboard type 바꾸기

-

UIKeyboardType enum 으로 다음과 같은 것들이 정의된다.


constant, enum, Example, IB, Interface builder, IOS, keyboard type, NSInteger, NS_ENUM, sample, setKeyboardType, typedef, UIKeyboardType, UIKeyboardTypeASCIICapable, UIKeyboardTypeASCIICapableNumberPad, UIKeyboardTypeDecimalPad, UIKeyboardTypeDefault, UIKeyboardTypeEmailAddress, UIKeyboardTypeNamePhonePad, UIKeyboardTypeNumberPad, UIKeyboardTypeNumbersAndPunctuation, UIKeyboardTypePhonePad, UIKeyboardTypeTwitter, UIKeyboardTypeURL, UIKeyboardTypeWebSearch, UITextField, UITextView, xcode, [iOS] keyboard type 바꾸기


typedef NS_ENUM(NSInteger, UIKeyboardType) {

    UIKeyboardTypeDefault, 

    UIKeyboardTypeASCIICapable,

    UIKeyboardTypeNumbersAndPunctuation,

    UIKeyboardTypeURL,

    UIKeyboardTypeNumberPad,

    UIKeyboardTypePhonePad,

    UIKeyboardTypeNamePhonePad,

    UIKeyboardTypeEmailAddress,

    UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1),

    UIKeyboardTypeTwitter NS_ENUM_AVAILABLE_IOS(5_0),

    UIKeyboardTypeWebSearch NS_ENUM_AVAILABLE_IOS(7_0),

    UIKeyboardTypeASCIICapableNumberPad NS_ENUM_AVAILABLE_IOS(10_0), 

    UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable, // Deprecated

};



-

예를 들어 아래 코드를 통해 숫자 키패드를 설정할 수 있다.

[textField setKeyboardType:UIKeyboardTypeNumberPad];

UITextView 에도 설정할 수 있고, 

코드가 아닌 IB ( Interface Builder ) 를 통해서도 설정할 수 있다.





반응형

댓글