在Chrome浏览器中以其他方式在Web视图上以移动宽度显示响应式网站(不响应) [英] Responsive website show on Web view out of mobile width(Not Responsive) other way in Chrome Looks Good

查看:207
本文介绍了在Chrome浏览器中以其他方式在Web视图上以移动宽度显示响应式网站(不响应)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用webview加载响应式网站,但显示的宽度超出了移动设备尺寸.

I am using webview to load the responsive website but it shows the width outside to the mobile size.

我在移动Chrome浏览器中打开了链接,看起来不错...

I open the link in a mobile Chrome browser and it looks good...

我的意思是说宽度不适合手机的屏幕尺寸;它显示超出宽度.

I mean to say the width does not fit to screen size of mobile; it shows out of width.

我还在<viewport>标签上使用这些...来控制其展示.

I am also using these... for <viewport> tag for controlling its presentation.

    WebSettings settings = webview.getSettings();
    settings.setJavaScriptEnabled(true);

    settings.setUseWideViewPort(true);
    settings.setLoadWithOverviewMode(true); 

我也正在使用setInitialScale进行Webview正确渲染.

Also I am using setInitialScale for webview render properly.

    webview.setInitialScale((int) 1.0);

但是我得到的网站负载大小并没有响应...显示宽度超出了屏幕尺寸...滚动附带了

but I am getting the website load not responsive as according to size... it shows the width is outside to screen size... which comes with scroll

应用程序在棒棒糖,棉花糖等中正常运行,但在豆形软糖等中则无效. 但是,该链接在所有设备上都适用于最新的Chrome,但在webview中不起作用.

Application works fine in Lollipop, Marshmallow etc. But does not work in Jellybean etc. But the Link works well with latest chrome in all devices but does not work in webview.

我也设置了这个....

I also set this....

 <meta name="viewport" content="width=device-width, initial-scale=1">

屏幕截图

推荐答案

尝试一下:

WebView browser = (WebView) findViewById(R.id.webview);
browser.getSettings().setLoadWithOverviewMode(true);
browser.getSettings().setUseWideViewPort(true);

这篇关于在Chrome浏览器中以其他方式在Web视图上以移动宽度显示响应式网站(不响应)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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