toast.show()


Type Function

Return value none

See also toast.*


Overview

Shows a toast message.

Syntax

toast.show(message, [params])

name required

String. Text to be displayed.

params optional

Table. Additional parameters.

Parameter reference

The params table includes parameters for the call.

duration optional

String. Display time, possible values are 'short' and 'long'. Short is 2 seconds, long is 3.5 seconds. On Android it is system dependent. Default value is 'short'.

gravity optional

String. A point on the screen, to which the toast message is anchored. Possible values:

'TopLeft'    'TopCenter'    'TopRight'
'CenterLeft' 'Center'       'CenterRight'
'BottomLeft' 'BottomCenter' 'BottomRight'

Default is 'BottomCenter'.

offset optional

Array. Contains two values: horizontal offset and vertical offset from the anchor point. These values are not in pixels, but in device points instead (scales with device screen density). Default is {64, 64} or {64, 0} or {0, 64} or {0, 0} depending on the gravity value.