ios - Search Bar not showing on iPhone 4S -
i'm pulling hair out one. i've created view in storyboard:
when i'm running on iphone 5s it's working fine, search bar displayed should. when i'm running on iphone 4s search bar isn't displayed can see in image below:
running on emulator shows search bar correctly in either sizes. in viewdidload
have following code:
- (void)viewdidload { [super viewdidload]; [self.processtableview setdelegate:self]; [self.processtableview setdatasource:self]; self.searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:nil]; self.searchcontroller.searchresultsupdater = self; self.processtableview.tableheaderview = self.searchcontroller.searchbar; self.definespresentationcontext = yes; }
i found out issue related line self.processtableview.tableheaderview = self.searchcontroller.searchbar;
don't understand why. have idea of what's going on here?
have tried
self.definespresentationcontext = yes;
this how implement it:
self.searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:nil]; self.searchcontroller.searchresultsupdater = self; self.searchcontroller.dimsbackgroundduringpresentation = no; self.searchcontroller.searchbar.delegate = self; self.tableview.tableheaderview = self.searchcontroller.searchbar; self.definespresentationcontext = yes; [self.searchcontroller.searchbar sizetofit]; self.searchcontroller.hidesnavigationbarduringpresentation = no;
Comments
Post a Comment