WebView android 不换行文本 [英] WebView android does not wrap the text

查看:47
本文介绍了WebView android 不换行文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在互联网上搜索了解决方案,但找不到.

我有一个显示文本的 WebView,只是文本.我想将文本包裹在 WebView 中,这可能吗,还是什么?

而且我想让用户能够在 WebView 中选择某个文本并让他能够通过短信发送所选文本,这可能吗?

解决方案

我找到了解决方案.你必须在你的 web 文档上添加一些 div 标签,然后添加一个 css 类.我是这样做的:

使用这样的 css 类:

.wrap {自动换行:断字;}

I've searched the Internet for a solution but I can't find it.

I have a WebView that display text, Just text. I want to wrap the text in the WebView, is that possible, or what?

And I want to make the user be able to select a certain text in the WebView and make him able to send the selected text by SMS, is that possible to?

解决方案

I found the solution. You have to add some div tag on your web document, and then add a css class. I did this:

<div class="wrap">

with a css class like this:

.wrap {
    word-wrap:break-word;
}

这篇关于WebView android 不换行文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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