Displaying a background image on UIWebView

前端 未结 4 669
独厮守ぢ
独厮守ぢ 2021-01-03 04:16

I\'m trying to build a native application that for all intents and purposes is HTML/CSS and Javascript. It all works fine, but when the UIWebView loads there\'s a delay whi

4条回答
  •  一生所求
    2021-01-03 04:47

    I've had to do the following in my code to get a transparent background on my UIWebViews - I usually do this in the viewDidLoad method of the UIViewController

    self.webView.backgroundColor = [UIColor clearColor];
    self.webView.opaque = NO;
    

    I think you can also make those changes in Interface Builder in the UIWebViews properties.

    --- edit ---

    And for the background image you can just put a UIImageView in behind the UIWebView now that you've given it a transparent background.

提交回复
热议问题