NKTextField
Overview
This control is used for user text input
init(x, y, width, height)
initializes text field with given coordinates and size
show()
shows control (not creating)
hide()
hides control (not destroying)
setString(value)
sets string value in control
getString()
synchronous method returning contents of the control in string form (if you need other type please use parseInt, parseFloat, etc)
setKeyboardType(keyboardType)
sets the type of keyboard
Parameters:keyboardType: the type of keyboard to use, available values are: "ASCII",
"NumbersAndPunctuation", "URL", "NumberPad", "PhonePad" and "EmailAddress",
from iOS 4.1 "DecimalPad" also available, if the device has older OS "NumberPad" will
be used automatically instead.
setTextChangeCallback(callback)
sets the callback which will be called every time text field is modified, format is following callback(newValue), where newValue is the new modified value of the text field
setBorderStyle(style)
sets border style for the text view, possible values are: "none", "line", "bezel", "rounded", the default value is "rounded".
setPlaceholder(placeHolder)
sets placeholder string which will be shown before user input starts
dismissKeyboard()
dismisses text field keyboard
showKeyboard()
makes text field first responder. Should be used ONLY after all controls are created, for example if you call show keyboard and then create new button then it wonʼt work.
setSecure(isSecure)
sets the secure type of keyboard, all input will be replaced by bullets. Takes parameters "yes" or "no".
Example:
var textFied = new NKTextField();
textFied.init(20, 120, 200, 30);
textFied.setKeyboardType("PhonePad");
textFied.show();

