WYSIWYG in Android webview

前端 未结 2 1152
暗喜
暗喜 2021-01-03 07:15

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,

2条回答
  •  [愿得一人]
    2021-01-03 08:03

    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

提交回复
热议问题