简体   繁体   中英

How to change the line spacing of the text in UIWebView in Swift

I am having a UIWebView which has a certain paragraph in it. I wanted to set the line spacing between the lines of that paragraph. Can anyone help me with this...?

Thanks in advance..

You have to add javascript code for line spacing into the UIWebView's source by calling this

func stringByEvaluatingJavaScript(from script: String) -> String?

For Example:
        let JSString = //A javascript code for line spacing
        webview.stringByEvaluatingJavaScript(from:JSString)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM