相关疑难解决方法(0)

如何在Android webview中禁用水平滚动

我想在我的webview中只有垂直滚动,不想要任何水平滚动.

webSettings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

这有助于我解决滚动问题.

但使用这个使我的webview看起来很奇怪.所有编辑文本的高度被挤压(垂直)并且看起来很糟糕.

  • 有没有其他方法可以禁用客户端的水平滚动?

  • 使用SINGLE_COLUMN我们如何避免webview高度变化问题?我希望垂直外观与以前没有SINGLE_COLUMN的情况相同

java android webview

16
推荐指数
2
解决办法
4万
查看次数

如何在Android中停止WebView的INTERNAL滚动?

我的应用程序中有一个WebView,其中包含HTML内容,HTML内容的大小大于WebView的大小.当用户将他/她的手指拖到其上时,由于哪些内容在其内部滚动.我想停止内容滚动发生内容.

这是迄今为止我已经尝试过的内容:

WebView view = new WebView(context);  //context is of Activity
view.setHorizontalScrollBarEnabled(false);
view.setVerticalScrollBarEnabled(false);
view.setScrollContainer(false);
Run Code Online (Sandbox Code Playgroud)

在CSS中:

overflow : hidden !important;
Run Code Online (Sandbox Code Playgroud)

请建议除了禁用手指拖动(黑客)以进行webview 之外的解决方案,因为这会影响我的其他功能,如下所示:

@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
    if(motionEvent.getAction() == MotionEvent.ACTION_MOVE)
    {
        return true;
    }
  }
Run Code Online (Sandbox Code Playgroud)

html css android scroll webview

9
推荐指数
1
解决办法
2785
查看次数

在Android中将HTML加载到webview中?

我正在将html内容加载到webview中.但我得到以下错误:

网页不可用text/html; utf8%3C!DOCTYPE%20HTML%20PUBLIC%20 // W3C // ........

和更多

这是我的HTML内容

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 

Transitional//EN'><html><head><title>Personality ABC</title></head><body><table 

border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td 

align="center"><strong>[Red-Blue] Sachin</strong><br /><img 

src="r7y3b6.png" alt="[Red-Blue] 

Sachin" title="[Red-Blue] Sachin" /><br />Sachin</td><td align="center"><strong>

[Yellow-Red-Blue] Test1</strong><br /><img src="5y5b5.png" alt="[Yellow-Red-Blue] Test1" title="[Yellow-

Red-Blue] Test1" /><br />Test1</td></tr></table><br/><p><strong>Harmony:</strong></p>
<p><strong>Test1</strong> and <strong>Sachin</strong> experience lots of similarities 

together. Both personalities have strong red (dominant, authoritative and impatient) 

and blue (rational, reserved and analytic) sides and understand each other&rsquo;s 

nature; both being rational, thoughtful but dominant, authoritative and …
Run Code Online (Sandbox Code Playgroud)

android webview

3
推荐指数
1
解决办法
7819
查看次数

标签 统计

android ×3

webview ×3

css ×1

html ×1

java ×1

scroll ×1