Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UISearchController-结果显示在搜索栏下_Ios_Objective C_Uitableview_Uisearchcontroller - Fatal编程技术网

Ios UISearchController-结果显示在搜索栏下

Ios UISearchController-结果显示在搜索栏下,ios,objective-c,uitableview,uisearchcontroller,Ios,Objective C,Uitableview,Uisearchcontroller,我一直在将我的搜索从旧的UISearchDisplayController转换为新的UISearchController。我现在已经把一切都做好了,但我的最后一个问题是显示的结果表视图。 结果表视图显示在搜索栏下方,当您向下滚动时,表视图将通过状态栏 附件是一些显示问题的图片,是否有人对为什么会发生这种情况有任何建议。我已经包含了ViewDidLoad中的一些设置代码 ` 谢谢, 安德鲁 if ([self respondsToSelector:@selector(edgesForExten

我一直在将我的搜索从旧的UISearchDisplayController转换为新的UISearchController。我现在已经把一切都做好了,但我的最后一个问题是显示的结果表视图。 结果表视图显示在搜索栏下方,当您向下滚动时,表视图将通过状态栏

附件是一些显示问题的图片,是否有人对为什么会发生这种情况有任何建议。我已经包含了ViewDidLoad中的一些设置代码

`

谢谢, 安德鲁

if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars=NO;
self.automaticallyAdjustsScrollViewInsets=NO;
[self.navigationController setNavigationBarHidden:NO animated:YES];
[super viewDidLoad];
self.extendedLayoutIncludesOpaqueBars = YES;
self.navigationController.navigationBar.translucent = NO;
[self setNeedsStatusBarAppearanceUpdate];

// create a filtered list that will contain products for the search results table.
self.filteredItems = [NSMutableArray arrayWithCapacity:[self.listContent count]];

 // Initially display the full list.  This variable will toggle between the full and the filtered lists.
self.displayedItems = self.listContent;
self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
self.searchController.searchResultsUpdater = self;
self.searchController.searchBar.delegate = self;
self.searchController.dimsBackgroundDuringPresentation = NO;


[self.searchController.searchBar sizeToFit];
self.searchController.searchBar.placeholder = @"";

// Add the UISearchBar to the top header of the table view
self.TV.tableHeaderView = self.searchController.searchBar;
self.definesPresentationContext = YES;

UIView *theView = [[UIView alloc] initWithFrame:TV.frame];
    [theView setBackgroundColor:[UIColor colorWithRed:0.090 green:0.388 blue:0.643 alpha:1]];
    [TV setBackgroundView:theView];

[TV reloadData];
self.navigationItem.title = @"Search";