gpt4 book ai didi

javascript - 使用 Javascript 获取内容的高度,移动 Web View

转载 作者:行者123 更新时间:2023-11-28 22:28:05 26 4
gpt4 key购买 nike

假设我的移动应用程序中有一个 Web View ,我需要知道该 View 内容的高度,我不确定这对 document.body.height 或找到body 元素的第一个 child ,还有其他方法吗?谢谢!!

最佳答案

Can I get the height of content without knowing the HTML structure of the view

好吧,在 JS 和 native 级别都有 API。尝试 http://developer.android.com/reference/android/view/View.html#getMeasuredHeight%28%29

有时,建议稍微延迟调用它们。

关于javascript - 使用 Javascript 获取内容的高度,移动 Web View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18330031/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com