iOS Question Accessing WKWebView Alpha Level Property @ Runtime

dbalman

Member
Licensed User
Longtime User
My purpose is to achieve a page darkening effect with a black panel behind the WKWebView. This is what I've come up with:

B4X:
#IF OBJC
    - (void )setTransparent: (UIWebView*)WKWebView {
        [WKWebView setBackgroundColor:[UIColor clearColor]];
        [WKWebView setOpaque:NO];
    }
   
   - (void )setOpaque: (UIWebView*)WKWebView {
        [WKWebView setBackgroundColor:[UIColor whiteColor]];
        [WKWebView setOpaque:YES];
    }
   - (void )setAlpha: (UIWebView*)WKWebView {
        [WKWebView setBackgroundColor:[UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:0.8f]];
        [WKWebView setOpaque:NO];
    }
#END IF

The first two methods work as expected, but the setAlpha method is not. What am I doing wrong? Is there a better way to access the WKWebView's alpha level property?
 
Top