richeditor-android icon indicating copy to clipboard operation
richeditor-android copied to clipboard

How to change the size of the insert picture?

Open asdasadasf opened this issue 8 years ago • 4 comments

asdasadasf avatar Feb 04 '17 09:02 asdasadasf

        findViewById(R.id.action_insert_image).setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                mEditor.insertImage("http://file.yirimao.com/1488878219-771243-0.jpg\" style=\"width:100%;", "alt");
                String html = mEditor.getHtml();
            }
        });

i found a way, but a bit @stranger.

laughmaker avatar Mar 08 '17 07:03 laughmaker

edit the style.css under the asset folder, and add code like this: img { width:80%; }

gindoc avatar Apr 22 '17 06:04 gindoc

修改js文件中insertImage方法,添加参数width,height, var html = '</br><img style="margin:0 auto; width:'+ width +'px;height:' + height+ 'px" src="'+url+'" alt="'+alt+'" /></br>';

AndroidChenLei avatar Nov 06 '17 06:11 AndroidChenLei

可以替换,让它适配屏幕 content = content.replace("<img","<img style="max-width:100%;height:auto"");