跳至主要內容

取得一個 webview 的區域及層級資訊 (webview.frame)

聲明​

frame = webview.frame([ id ])

參數​

  • id
    整數型,可選參數,表示目前 webview 的 id,範圍 1 ~ 1000,預設為 1

回傳值​

  • frame
    表型,返回目前 webview 的區域及層級資訊

說明​

取得一個 webview 的區域及層級資訊

範例​

local frame = webview.frame(1)
sys.alert(
"位置为:".."("..frame.x..","..frame.y..")\n"..
"大小为:".."(宽:"..frame.width..",高:"..frame.height..")\n"..
"层级为:".."("..frame.level..")"
)

注:上述代碼中使用了非本章函式 sys.alert