4

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.

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.

Sorry for the size!

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?

Thanks a LOT in advance!

4

2 回答 2

8

EditText完全能够显示富文本。只是用户——甚至开发人员——没有简单的方法来真正控制这种格式。因此,我一直在寻找一个图书馆来处理这个问题,提供一个RichEditText替代EditText. 这仍然是一项正在进行的工作,我真的需要在不久的将来花更多的时间在它上面。

于 2013-06-14T18:47:00.750 回答
2

Andoird API 的Webview支持 HTML 的内容可编辑。

webSettings.setJavaScriptEnabled(true)
webSettings.setDomStorageEnabled(true);
webSettings.setLightTouchEnabled(true);

启用 webview 可编辑然后使用

 webview.loadurl("javascript:....")

如 :webView.loadUrl("javascript:document.execCommand('bold', false, null);"); 控制编辑。

您可以在 Android 上看到我的应用程序的WYSIWYG 编辑,YodaNote 0.4 的 WYSIWYG 编辑

于 2013-10-11T01:52:18.673 回答