Skip to content

Instantly share code, notes, and snippets.

@josephchang10
Created January 22, 2017 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephchang10/3be159ed848dc4d71e23134aced72afa to your computer and use it in GitHub Desktop.
Save josephchang10/3be159ed848dc4d71e23134aced72afa to your computer and use it in GitHub Desktop.
初次加载隐藏搜索框
- (void)initSearchBar
{
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];
[searchBar sizeToFit];
searchBar.placeholder = [IFI18nUtils getLocalizedString:@"SEARCH"];
searchBar.delegate = self;
searchBar.backgroundColor = [UIColor clearColor];
[self.collectionView setContentInset:UIEdgeInsetsMake(-44, 0, 0, 0)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment