2011-12-14 90 views
0

激活后是否有可能在UISearchBar的效果中禁用灰色淡入淡出效果。 我tryed在viewDidLoad中下面并没有什么工作:在UISearchBar中禁用淡入淡出

self.tableView.backgroundColor = [UIColor clearColor]; 
self.tableView.backgroundView.frame = [[UIView alloc] initWithFrame:CGRectZero]; 
self.tableView.backgroundView.backgroundColor = [UIColor clearColor]; 

回答

1

您可以在- (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar功能代码所需的行为

您可以参考这个helpful tutorial,只是删除以下部分,它负责的衰落效果

[UIView beginAnimations:@"FadeIn" context:nil]; 
[UIView setAnimationDuration:0.5]; 
self.disableViewOverlay.alpha = 0.6; 
[UIView commitAnimations];