Skip to main content

Show a webview (webview.show)

Declaration

webview.show { -- all fields optional
html = HTMLContent,
x = X,
y = Y,
width = Width,
height = Height,
corner_radius = CornerRadius,
alpha = Opacity,
animation_duration = Duration,
rotate = Rotation,
level = WindowLevel,
opaque = Opaque,
ignores_hit = IgnoresHit,
can_drag = CanDrag,
is_secure = IsSecure,
id = Id,
}

Fields

  • html
    String. Optional. HTML content of the page. Defaults to the value set in the previous webview.show call.
  • id
    Integer. Optional. The id of current webview (1 ~ 1000). Defaults to 1. Multiple webviews can coexist with different ids.
  • x
    Integer. Optional. Distance from the left. Default 0.
  • y
    Integer. Optional. Distance from the top. Default 0.
  • width
    Integer. Optional. Window width. Defaults to screen width.
  • height
    Integer. Optional. Window height. Defaults to screen height.
  • alpha
    Number. Optional. Opacity in range 0.0 ~ 1.0. Default 1.0.
  • corner_radius
    Number. Optional. Corner radius. 0.0 means squared corners. Default 0.0.
  • animation_duration
    Number. Optional. Animation duration from previous state to the new state. Default 0.0.
  • rotate
    Number. Optional. Rotation: 0.0 (portrait), 90.0 (landscape home-right), 180.0 (portrait upside-down), 270.0 (landscape home-left). Default 0.0.
  • level
    Number. Optional. Window level. Default 1100.0.
  • opaque
    Boolean. Optional. Whether the background is opaque. Default true.
  • ignores_hit
    Boolean. Optional. Whether to ignore (not intercept) touch events. Default false. This cannot be changed after the webview is created.
  • can_drag
    Boolean. Optional. Whether the webview can be dragged. Default false.
  • is_secure (Available since XXT 1.3.8)
    Boolean. Optional. On iOS 13.2+, whether the webview is a secure view. Default false. When true, the webview cannot be captured via screenshot, color pickers, or screen recording.

Notes

  • Show a webview according to the given parameters.
  • Except for the html field, all other fields reset to their default values when calling show.

Example

See Samples