在与Android的web视图底部多余的空间问题 [英] Problem with extra space at the bottom of android Webview

查看:95
本文介绍了在与Android的web视图底部多余的空间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中的web视图,其中i显示使用loadData()方法中的HTML内容。问题是,HTML内容以及在底部的一些额外的空间显示,我不明白为什么白色空间即将到来。这个问题只出现在摩托罗拉Milestone设备(Android 2.1的)。请有人帮助理清这个问题。

I have an Webview in my application where i display the html content using loadData() method. The Problem is HTML content is displayed along with some extra space at the bottom, I could not understand why the white space is coming. This problem is occurring only in Motorola Milestone device(Android 2.1). Please somebody help to sort out this problem.

在此先感谢, Rajapandian

Thanks in Advance, Rajapandian

推荐答案

最后,我发现我自己的问题的答案,我需要将其添加到web视图之前追加meta标签随着我的HTML内容。请从下面

At last I found the answer for my own question, I need to append the meta tag along with my HTML content before adding it to the Webview. Please find the Code below

 String s="<head><meta name='viewport' content='target-densityDpi=device-dpi'/></head>";            
 webview.loadDataWithBaseURL(null,s+htmlContent,"text/html" , "utf-8",null);      

做的伎俩的meta标签内的视口物业,请参考以下链接了解详情。

The Viewport property inside the meta tag done the trick, please refer the following link for further details.

在Android的web视图使用视窗

问候, Rajapandian

Regards, Rajapandian

这篇关于在与Android的web视图底部多余的空间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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