UI API
UI API
getMenuButtonBoundingClientRect()
查询右上角菜单按钮的位置信息。用于 UI 布局排列。
返回值:
| 字段 | 类型 | 说明 |
|---|---|---|
top | number | 顶部坐标 (px) |
right | number | 右侧坐标 (px) |
bottom | number | 底部坐标 (px) |
left | number | 左侧坐标 (px) |
width | number | 按钮宽度 (px) |
height | number | 按钮高度 (px) |
const rect = TudadaSDK.getMenuButtonBoundingClientRect();
console.log('位置:', rect.top, rect.right, rect.bottom, rect.left);
console.log('尺寸:', rect.width, 'x', rect.height);