const main = plus.android.runtimeMainActivity()
const windowMe = main.getWindow()
plus.android.importClass(windowMe)
const decorView = windowMe.getDecorView()
plus.android.importClass(decorView)
const windowInsets = decorView.getRootWindowInsets()
const WindowInsets = plus.android.importClass(windowInsets)
const insets = windowInsets.getInsets(WindowInsets.Type.navigationBars())
const navigationBarHeight = plus.android.getAttribute(insets, 'bottom')
console.log(navigationBarHeight) // 取到的是物理像素值,需要除以dpr转为逻辑像素值
2***@qq.com
- 发布:2024-10-17 14:53
- 更新:2024-12-29 10:55
- 阅读:101
android下获取系统导航栏高度
分类:uni-app
5 个评论
要回复文章请先登录或注册
1***@qq.com
2***@qq.com (作者)
靐齉齾麤龖龗
2***@qq.com (作者)
靐齉齾麤龖龗