- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在使用一个插件来创建另一个与主要应用程序 WebView 重叠的 WebView(Appodeal 横幅)。没有一个好的方法来解决操纵 HTML 标签的问题,因为元素困惑
默认横幅设置
32px : device screen height <= 400
50px : 400 < device screen height <= 720
90px = device screen height > 720
因此 webview 必须根据 Appodeal 横幅高度调整高度。
示例:
if (device.screen.height <= 400) {
WebView.height = WebView.height - "32px"
}
PS:我不是 Java 程序员,只是 Web 开发人员
最佳答案
我不确定您是否必须在 Admob 横幅广告上调整根 webview 的大小(我什至不确定这是否可能)。但是您需要做的就是在显示横幅时重新布局主 webview 的内容。如果我理解你的帖子,你使用 Appodeal PhoneGap Plugin真正使用了一个更多的 webview 组件来展示广告。在这种情况下,您对以下内容了如指掌:
Appodeal.BANNER_TOP | Appodeal.BANNER_BOTTOM
);document.addEventListener('onBannerShown', function(){...});
);所以,我只是在我的 HTML 模板中准备一个空的占位符,添加 CSS 规则,当没有显示 Appodeal 横幅时将隐藏它们,onBannerShown
事件将显示相应的占位符并调整我所有 webview 的大小内容。
<style>
.appodeal-top {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 0;
}
.main-content {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.appodeal-show .appodeal-top {
/* replace it with appropriate value calculated on device height */
height: 50px;
}
.appodeal-show .main-content {
/* replace it with appropriate value calculated on device height */
top: 50px;
}
</style>
<script>
document.addEventListener('onBannerShown', function(){
document.getElementById('root').className = 'appodeal-show';
});
</script>
<div id="root">
<div class="appodeal-top"></div>
<div class="main-content">
...
</div>
</div>
(我没有尝试此代码 - 它只是向您展示了一个想法)。
关于java - 如何在 Cordova/Phonegap 项目上设置条件 WebView 调整大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37580689/
Webview shouldInterceptRequest方法总是返回null。我去了adblocking的use方法。我尝试了很多adblock方法,但是总是需要这个shouldIntercept
在我的 Native React 项目中,我想使用 WebView。 HTML是指外部的css文件,css文件是指一些自定义字体。 鉴于此层次结构: app/ app/index.ios.js app
我在一个页面上有多个 webview,当应用程序加载时,主页面卡住了将近 8-10 秒,我猜测这是所有 webview 加载各自网站所花费的时间,为什么 Ui 卡住了,我怎么能使 webview 加载
nativescript 中的 webview 是否有“导航”事件? 我已经在 Xamarin (c#) 中用 完成了 Browser.Navigating += Myfunction natives
我的浏览器 (webview) 以 HTML 页面开头 FILEJAVA.class.getResource ("FILEHTML.html")。 ToExternalForm () 每当我访问谷歌时
我们正在开发一个 JavaFX 2.x 应用程序,它需要提供一些 GIS 支持。我们得出的结论是,通过嵌入式 WebView 使用 GoogleMaps 是最快的选择。它的问题在于每次我们的应用程序启
有没有办法销毁 WebView 实例?如果页面加载,并说视频开始播放,我希望能够,当我隐藏 WebView 时,基本上可以销毁它,或者至少重置它。 我知道我可以听 visibleProperty 并执
有没有办法在不启用远程模块的情况下在 webview 和主窗口之间进行通信? When this attribute is false the guest page in webview will
我使用以下代码来拦截Web View 中的对话框,但看不到内容或无法与之交互: Element webview= querySelector("#webview"); Map map=new
我正在创建一个页面,该页面将在 Java 的 WebView 中打开,或在外部浏览器中手动打开。如果页面是从 Java 加载的——我需要它来执行特定的回调,因为 Java 被用作一种后端,但如果页面是
我有一个 React Native WebView ,它运行一个小的 HTML 文档。该文档显示了一些图像。 我希望显示位于应用程序的 Documents 文件夹中的图像,即图像不是静态 Assets
我正在使用 JavaFX webview 开发一个网络爬虫。出于抓取目的,我不需要加载图像。当页面被加载时,Webkit 会产生很多 UrlLoader 线程。所以我认为最好禁用图像,这样我会节省很多
这个问题在这里已经有了答案: Android webview launches browser when calling loadurl (11 个答案) 关闭 7 年前。 我花了两天的时间来寻找一
我正在加载一个网页,我想使用基本身份验证登录,我有使用 Swift 的经验并且能够像下面那样执行基本身份验证,但我无法为我的应用程序的 Flutter 版本实现基本身份验证。 ---- swift 代
我用 webview 创建了应用程序,我想在 webview 中加载所有内部链接并在 android 浏览器中加载外部链接。现在的问题是我正在使用 html 广告,当我点击广告时我想打开外部浏览器,但
我需要在父背景图案上显示我的 webview 内容。有没有直接的方法来做到这一点? 最佳答案 这可能有用 final com.sun.webkit.WebPage webPage = com.sun.
是否可以从 webview 中加载的页面读取 http 请求和响应数据。我想要做的是在用户单击 webview 中页面内的链接后从响应中获取二进制数据。任何帮助或线索将不胜感激 最佳答案 创建您自己的
我有一个简单的WebView在 Android 上运行 Web 应用程序。问题是当我旋转手机以将其更改为横向 webview重新加载并回到开头。 我怎样才能防止这种行为? 罗恩 最佳答案 从 Andr
我创建了一个带有 webview 标签的自定义浏览器。当我在 google.it(或 google.com)中导航时,有时会出现一条消息说 chrome 已过时。我的应用版本是: Node.js 8.
我正在使用 Electron 创建简单的网络浏览器。我的用例是我需要通过不同/各自的代理 IP 路由每个 URL。如果用户输入 google.com,则必须通过 123.123.122.1:8081
我是一名优秀的程序员,十分优秀!