Webview.align readwrite property
Get or set the Webview alignment, which position and size will be aligned relative to its parent (alignment persists even if the size of the parent changes).
This property uses a string
to specify the Webview alignment :
- "all" : the Webview will be aligned along all the parent borders (and will cover the entire parent client area).
- "bottom" : the Webview will be aligned along the bottom border of the parent, preserving its height.
- "top" : the Webview will be aligned along the the top border of the parent, preserving its height.
- "right" : the Webview will be aligned along the right border of the parent, preserving its width.
- "left" : the Webview will be aligned along the left border of the parent, preserving its width.
Example
local ui = require "ui"
require "webview"
-- create a fixed Window
local win = ui.Window("Webview:align() sample", "fixed", 320, 200)
-- create a Webview without an URL
local wv = ui.Webview(win, 25, 25)
-- align the Webview in all of its parent area
wv.align = "all"
-- Once the webview widget is ready, navigate to the provided URL
function wv:onReady()
wv.url = "https://www.luart.org"
end
-- shows the Window
win:show()
while win.visible do
ui.update()
end