Jack Berstrem
Jack Berstrem

Reputation: 535

How would I go about justifying text in a UIWebView?

I am loading a local HTML string into a UIWebView but it is not justified.

How can I make my text justified ?

P.S. Don't mind the stupid text, it's for a comedy journal at my university.

Screenshot

EDIT 1: still not working

        let justifiedArticleContent = "<p style=\"text-align:justify\"> \(editorialArticleContentThroughSegue) </p>"

    editorialDetailWebView.loadHTMLString(justifiedArticleContent, baseURL: nil)

Screenshot 2

Upvotes: 0

Views: 1083

Answers (1)

Code Different
Code Different

Reputation: 93161

You need to learn some CSS:

let htmlString = "<p style=\"text-align:justify\">As is the same with many students...</p>"

Upvotes: 1

Related Questions