嗨,我无法使用 隐藏我的表格视图[self.autocompleteTableView setHidden:YES];
,但它适用于 ios 10,但在 ios 11 中它没有隐藏表格视图。
任何人都可以帮助我吗?
这是我的代码:
-(void) seachBarSetup{
self.autocompleteTableView = [[UITableView alloc] initWithFrame:CGRectMake(self.profileMapSearchBar.frame.origin.x, self.profileMapSearchBar.frame.origin.y + self.profileMapSearchBar.frame.size.height, self.profileMapSearchBar.bounds.size.width, self.view.frame.size.height - self.profileMapSearchBar.bounds.size.height - 64) style:UITableViewStylePlain];
self.autocompleteTableView.estimatedRowHeight = 60.0;
self.autocompleteTableView.rowHeight = UITableViewAutomaticDimension;
self.autocompleteTableView.delegate = self;
self.autocompleteTableView.dataSource = self;
if (@available(iOS 11.0, *)) {
self.autocompleteTableView.insetsContentViewsToSafeArea = YES;
}
self.profileMapSearchBar.alpha = 0.8;
self.profileMapSearchBar.delegate = self;
[self.view addSubview:self.autocompleteTableView];
[self.autocompleteTableView setHidden:YES];
self.profileMapSearchBar.barTintColor = [UIColor whiteColor];
[self.profileMapSearchBar sizeToFit];
}