Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the size of the insert picture? #97

Open
asdasadasf opened this issue Feb 4, 2017 · 4 comments
Open

How to change the size of the insert picture? #97

asdasadasf opened this issue Feb 4, 2017 · 4 comments

Comments

@asdasadasf
Copy link

No description provided.

@laughmaker
Copy link

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

i found a way, but a bit @stranger.

@gindoc
Copy link

gindoc commented Apr 22, 2017

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

@AndroidChenLei
Copy link

AndroidChenLei commented Nov 6, 2017

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

@LongLongLongLongLongLongLongLongLong

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants