跳到主要内容

UI API

UI API

getMenuButtonBoundingClientRect()

查询右上角菜单按钮的位置信息。用于 UI 布局排列。

返回值:

字段类型说明
topnumber顶部坐标 (px)
rightnumber右侧坐标 (px)
bottomnumber底部坐标 (px)
leftnumber左侧坐标 (px)
widthnumber按钮宽度 (px)
heightnumber按钮高度 (px)
const rect = TudadaSDK.getMenuButtonBoundingClientRect();
console.log('位置:', rect.top, rect.right, rect.bottom, rect.left);
console.log('尺寸:', rect.width, 'x', rect.height);