0
Ich benutze Cordova um eine iOS App zu erstellen. Ich möchte mein Webview transparent sein und dahinter den verschwommenen Hintergrund des Usertapeten. Wie die iOS-Erinnerungs-App.UIVisualEffects, UIWebView transparenter Hintergrund
Ich weiß, es ist eine häufig gestellte Frage, aber ich habe nicht gefunden Antworten geben
Ist es möglich?
In meinem viewDidLoad Methode habe ich diese Zeilen:
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor clearColor];
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.frame = self.view.bounds;
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
//This line places a dark black background with my app being blurred behind it
[self.view addSubview:blurEffectView];
//This line instead just makes background of app plain black (the body of html app is transparent) and not blurred , I guess there is something wrong with view hierarchy maybe?
[self.view addSubview:self.webView];
[self.webView setOpaque:NO];
[self.webView setBackgroundColor:[UIColor clearColor]];
}
Vielen Dank im Voraus