Armen Nagapetyan
Armen Nagapetyan

Reputation: 31

swift 3 webView background color

I need a help with webView in swift 3.

I'm making a reader that read books in the html format - the problem is with the webView background colour.

I'm setting webView to break content on pages, like this:

    webView.paginationBreakingMode = .page

I'm setting the background in CSS, like this:

* {background-color: red;}

But I'm still getting a white background. This is not webView background, this is something else.

View screenshot

Upvotes: 3

Views: 2646

Answers (1)

swift2geek
swift2geek

Reputation: 1812

It can be done by setting in IB the webview's opaque property to NO. And set the background of the underneath view to desired colour.

Upvotes: 7

Related Questions