I have tried this multiple ways, all with no success. I have an app with a UITableView and a UISearchBar at the top. I am trying to make it so that when the user clicks on the search bar, a dark translucent background will appear over the table view, and dissapear when the user starts typing. I have seen this in the contacts application, and thought i was on the right track, but ran into trouble. In the searchBarTextDidBeginEditing

UISearchBar *)theSearchBar method i have this code:
Code:
if (overlay == nil) {
overlay = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 320, 436)];
[overlay setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.0]];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[overlay setAlpha:0.75];
[UIView commitAnimations];
}
I looked at the documentation for UIView, and it says that alpha in animateable. However, the overlay view doesnt appear.