Transparent background WKWebView (NSView)

后端 未结 5 1622
野性不改
野性不改 2021-02-08 12:27

I am building a Mac application using Swift. Therefor, I want to make a WKWebView transparent, so it shows the text of the loaded HTML, but the background of my underlaying NSWi

5条回答
  •  日久生厌
    2021-02-08 12:48

    Code below works for me perfectly, also color is set to clearColor by default.

    [wkWebView setValue:YES forKey:@"drawsTransparentBackground"];
    

提交回复
热议问题