Reputation: 2307
I have a UIWebView in a view but what i want to do is hide the background but still show the UIWebView. Im new to Mobile development. I have researched and used code from net but cannot find a solution can anyone please help. Thanks.
[UIView animateWithDuration:0.3 animations:^() {
view.alpha = 0.0;
}];
I have got the UIWebView to fade out but thats not what i want, basically the UIWebView still needs to be visible but the background to be faded out or make the background hidden but not the UIWebView
I have also tried:
[UIView beginAnimations: @"Fade Out" context:nil];
[UIView setAnimationDuration:2.0];
[self.view setAlpha:0.0f];
[UIView commitAnimations];
Seems to only fade out the UIWebView
Upvotes: 0
Views: 129
Reputation: 8465
You are setting the alpha on the view itself, which will be applied to the view and its subviews. Change its background color
[UIView animateWithDuration:0.3f animations:^{
view.backgroundColor = [UIColor clearColor];
}];
Upvotes: 1