问题描述
我一直在尝试从我的应用程序内部向用户提供一种所见即所得的HTML编辑器.不必一定是花哨的所见即所得.我只需要基本功能,例如粗体,斜体,下划线,图像,链接和一些基本格式(字体大小,颜色,对齐方式).那应该足够了.
I've been trying to offer a WYSIWYG HTML editor to my users, from inside my app. It doesn't have to be a fancy WYSIWYG. I just need basic functionality like Bold, Italic, Underline, images, link and some basic formatting (font size, colour, alignment). That should be enough.
理想的解决方案是使用开放源代码库,但我一直找不到.因此,我在Google上搜寻了可在Android上使用的基于网络的编辑器.我找到了服务员.当我启动我的Android浏览器(Chrome测试版)时,此编辑器的效果很好.它也可以从我的网络视图中正常工作(请参见屏幕截图),但事实并非如此.
The perfect solution would be an open source library, but I haven't been able to find one. So I googled around for a web-based editor that works on Android. I found Sceditor. This editor works great when I fire up my Android browser (Chrome beta). It SEEMS to work from my webview (see screenshot) as well, but it doesn't.
从应用程序内部运行编辑器后,大多数功能便停止工作.光标随机跳来跳去,我无法再编辑现有文本,并且发生了更多奇怪的事情.基本上,这是行不通的.
As soon as I run the editor from within the app, most functionality stops working. The cursor jumps around randomly, I cannot edit existing text anymore and more weird stuff happens. Basically, it just doesn't work.
问题:如何使它正常工作?
Question: How can I get this to work appropriately?
提前感谢很多!
推荐答案
EditText
完全能够显示富文本格式.只是没有简单的方法让用户-甚至开发人员-真正控制这种格式.因此,我一直在使用一个用于处理此问题的库进行操作,并提供一个RichEditText
插件替换EditText
.它仍在进行中,在不久的将来,我真的需要花更多的时间在上面.
EditText
is perfectly capable of displaying rich text. It's just that there's no easy way for users -- or even developers -- to really control that formatting. Hence, I've been poking off and on with a library to deal with this, offering a RichEditText
drop-in replacement for EditText
. It's still a work-in-progress, and I really need to spend more time on it in the not-too-distant future.
这篇关于Android Webview中的WYSIWYG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!