Type Number Object TextField Library native.* Revision Release 2021.3642 Keywords text size, native text input See also native.newTextField()
Gets or sets the native text field's font size.
Setting this property to
0 will make the text field use the system's default font size.
It is recommended that you call object:resizeHeightToFitFont() when changing the font size, because the default font size can vary considerably between devices. The advantage of this approach is that the native text field and its font size will be consistent when compared to other native apps on the same device.
The font size read or written to this property may be either in Corona's
By default, the font size is measured in Corona's
"isNativeTextFieldFontSizeScaled" key of display.setDefault().
-- Create a native text field local textField = native.newTextField( 50, 100, 100, 35 ) textField.align = "center" -- Change the text field's size property textField.size = 32 -- Resize the text field height to fit the font textField:resizeHeightToFitFont() textField:setTextColor( 1, 0.5, 0 ) textField.text = "Hello World!"