ios7上UITableview索引遮挡searchbar问题解决办法

searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 290.0, 44.0)];

UIView *customTableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
UINavigationBar *dummyNavigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
[customTableHeaderView addSubview:dummyNavigationBar];
[customTableHeaderView addSubview:searchBar];
[dummyNavigationBar release];

self.tableView.tableHeaderView = customTableHeaderView;
[customTableHeaderView release];

思路:headerview-->view-->navigationbar-->searchbar

你可能感兴趣的:(ios7上UITableview索引遮挡searchbar问题解决办法)