[英]Embedding “Rich Text Editor” in a web view
Now, I'm trying to embed " CKEditor " (Rich Text Editor) in my application. 现在,我正在尝试在应用程序中嵌入“ CKEditor ”(Rich Text Editor)。
"ckEditor" folder with all js and plugins is located inside "asset" folder". 带有所有js和插件的 “ ckEditor”文件夹位于“ asset”文件夹中”。
My problem is: output supposed to be like that 我的问题是:输出应该是这样的
In my case the output is like that : 就我而言,输出是这样的:
My Code is like : 我的代码就像:
1- Main Activity: 1-主要活动:
package com.example.webviewtest; 包com.example.webviewtest;
@SuppressLint("SetJavaScriptEnabled") public class MainActivity extends Activity { WebView webView; @SuppressLint(“ SetJavaScriptEnabled”)公共类MainActivity扩展了Activity {WebView webView; TextView myTextView; TextView myTextView;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView = (WebView) findViewById(R.id.webView1); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient()); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setDomStorageEnabled(true); webView.getSettings().setPluginState(PluginState.ON); webView.setWebChromeClient(new WebChromeClient()); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webView.loadUrl("file:///android_asset/ckeditor/index.html"); }
} }
I don't know the source of my problem, but , i think it's "JS" Issue...Any help..?!! 我不知道问题的根源,但是,我认为这是“ JS”问题……有什么帮助..?!!
- Update -更新
I uploaded the ckEditor folder on remote host, and i still get the same image "above" not only on my application but also in the browser..!!!!!! 我将ckEditor文件夹上载到了远程主机上,不仅在我的应用程序中,而且在浏览器中,我仍然得到相同的图像“上方”。
: :
经过CKEditor页面的一些导航后,我发现该编辑器未启用与Android设备兼容的功能,但是,您可以为自己的android设备手动启用该功能,后果自负,为此,您需要编辑“ core / env.js”文件并启用“搜索白名单”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.