如何设置web视图作为非全屏? [英] How to set WebView as non-fullscreen?

查看:173
本文介绍了如何设置web视图作为非全屏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用的WebView在我的Andr​​oid应用程序。我创建我的code端(不是XML)web视图。我的问题是;当我打电话的WebView的使用loadURL方法,web视图进入全屏模式。我如何保持web视图的尺寸,例如200×200像素?

I am trying to use a WebView in my Android application. I am creating my webview in code-side (not in XML). My problem is; when I call loadUrl method of webview, the webview goes fullscreen mode. How can I keep the size of the webview for example 200x200 pixels?

如果有当然欢迎任何其他选项,而不是web视图,:)

If there is any other option instead of webview, of course welcome :)

谢谢

推荐答案

很可能你看到的是不是你的活动,但浏览器的应用程序,因为你链接到网址做了重定向。使用 WebViewClient shouldOverrideUrlLoading()赶上重定向,并发送回自己的的WebView

Quite possibly what you are seeing is not your activity, but the Browser application, because the URL you linked to did a redirect. Use WebViewClient and shouldOverrideUrlLoading() to catch the redirect and send it back to your own WebView.

这篇关于如何设置web视图作为非全屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆