如何设置web视图作为非全屏?

编程入门 行业动态 更新时间:2024-10-24 06:29:34
本文介绍了如何设置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视图作为非全屏?

本文发布于:2023-07-11 12:21:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1094042.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   全屏   如何设置   web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!