Thursday, October 8, 2026
HomeiOS Developmentgoal c - iOS wkWebView set background shade utilizing PDF's

goal c – iOS wkWebView set background shade utilizing PDF’s

[ad_1]

I’m having an issue with wkWebView. The next code under works effective fixing pdf’s grey borders in different customary browsers.

Lately we have now modified to utilizing wkWebView in our app and for some cause the code under will not be working particularly for wkWebView. Any concepts?

That is my objc code:

for (UIView *object in wkWebView.scrollView.subviews) {
            if ([NSStringFromClass([object class]) isEqualToString:@"UIWebPDFView"]) {
                UIView *pdfView = object;
                [pdfView setBackgroundColor: [UIColor whiteColor]];
                for (UIView *pdfObjectSubview in pdfView.subviews) {
                    //[pdfObjectSubview setBackgroundColor: [UIColor whiteColor]];
                    if ([NSStringFromClass([pdfObjectSubview class]) isEqualToString:@"UIPDFPageView"]) {
                        UIView *uiPDFPageView = pdfObjectSubview;
                        [[uiPDFPageView layer] setShadowOpacity: 0.0f];
                        //[uiPDFPageView setBackgroundColor: [UIColor whiteColor]];
                        //[uiPDFPageView.layer setBackgroundColor: [UIColor whiteColor].CGColor];
                    }
                }
            }
        }

Can't make the gray background white around the PDF

Thanks upfront

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments