WYSIWYG in Android webview

自古美人都是妖i 提交于 2019-11-30 15:54:35

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.

Webview of Andoird API support content editable of HTML.

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

to enable webview editable and then use

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

such as :webView.loadUrl("javascript:document.execCommand('bold', false, null);"); to control editing.

your can see WYSIWYG editing of my application on Android, WYSIWYG editing of YodaNote 0.4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!