【发布时间】:2013-06-10 18:08:08
【问题描述】:
我有一个 html 文件。我使用 webview 显示这个 html 文件。
我尝试显示所有包含页面的文本。所以我锁定了 webview 的滚动。
并明智地显示页面。
我的问题是当我根据 webview 高度显示一些包含文本时,文本的最后一部分被剪切并显示一半。
喜欢这个
所以我的问题是如何像 textview 一样将文本填充放在 webview 中?
- 编辑
代码
wv=(WebView) findViewById(R.id.webView1);
//This is gesture For webpage
gestureDetector = new GestureDetector(myContext, new MyGestureDetector());//This For swipe gesture.
wv.setOnTouchListener(this);
wv.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);//Stop Horizontal scroll.
加载 Webview 网址数据。
wv.loadDataWithBaseURL("", All_Xml_str,"text/html" , "utf-8", "");
All_Xml_Str。获取 html 的全部内容。
我被困住了。
我尝试了很多东西,但都没有成功。
请帮帮我。
谢谢。
【问题讨论】:
-
尝试格式化您的 html 文件并签入 webview
-
@Ramkiran 我尝试了所有可能的事情。它是一个 epub 文件的页面,我读了这个并像这样显示。但不能成功。
-
检查一次this
-
@ZalaJanaksinh 在此处粘贴您的代码。
-
@ChiragPatel 我编辑我的问题。
标签: android html webview padding