@@ -68,7 +68,20 @@ - (void)viewDidLoad {
6868 [searchBar setTintColor: [UIColor whiteColor ]];
6969 [searchBar insertBGColor: [UIColor colorWithHexString: @" 0x28303b" ]];
7070
71- searchBar.translucent = NO ;
71+ searchBar.searchBarStyle = UISearchBarStyleDefault;
72+ // searchBar.searchBarStyle = UISearchBarStyleMinimal;
73+
74+ searchBar.translucent = YES ;
75+
76+ searchBar.backgroundColor = [UIColor clearColor ];
77+
78+ for (UIView *subview in self.searchBar .subviews )
79+ {
80+ NSLog (@" -%@ " ,[subview description ]);
81+ for (UIView *ssb in subview.subviews ) {
82+ NSLog (@" --%@ " ,[ssb description ]);
83+ }
84+ }
7285
7386 searchBar;
7487 });
@@ -83,12 +96,6 @@ - (void)viewDidLoad {
8396// searchVC.displaysSearchBarInNavigationBar = NO;
8497// }
8598 searchVC.displaysSearchBarInNavigationBar = YES ;
86- [searchVC.searchResultsTableView setContentInset: UIEdgeInsetsZero];
87- [searchVC.searchResultsTableView setScrollIndicatorInsets: UIEdgeInsetsZero];
88- searchVC.searchResultsTableView .sectionFooterHeight = 0 ;
89- searchVC.searchResultsTableView .sectionHeaderHeight = 0 ;
90- searchVC.searchResultsTableView .tableHeaderView = [[UIView alloc ] initWithFrame: CGRectZero];
91- searchVC.searchResultsTableView .tableFooterView = [[UIView alloc ] initWithFrame: CGRectZero];
9299 searchVC;
93100 });
94101
@@ -212,7 +219,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
212219 selectedTopicName = @" " ;
213220 }
214221 cell.textLabel .text = [NSString stringWithFormat: @" #%@ #" ,selectedTopicName];
215-
222+ [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: 12 ];
216223 return cell;
217224}
218225
@@ -276,7 +283,6 @@ - (void)searchDisplayController:(UISearchDisplayController *)controller willShow
276283
277284- (void )searchBarTextDidBeginEditing : (UISearchBar *)searchBar {
278285 [_mySearchDisplayController.searchResultsTableView reloadData ];
279-
280286}
281287
282288
@@ -285,26 +291,24 @@ - (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)cont
285291 [_mySearchDisplayController setActive: YES animated: YES ];
286292 [_mySearchDisplayController.searchBar setShowsCancelButton: YES animated: YES ];
287293
288- // self.mySearchDisplayController.searchResultsTableView.hidden = NO;
289- // _mySearchDisplayController.
290- // [_mySearchDisplayController.searchResultsTableView reloadData];
291-
292- // self.navigationController.navigationBar.translucent = YES;
294+ controller.searchResultsTableView .superview .bounds = CGRectMake (0 ,22 ,320 ,400 );
295+ for (UIView * v in controller.searchResultsTableView .superview .subviews ){
296+ if ([v isKindOfClass: NSClassFromString (@" _UISearchDisplayControllerDimmingView" )])
297+ {
298+ v.frame = CGRectMake (0 ,20 ,320 ,400 );
299+ //
300+ }
301+ }
293302}
294303
304+
295305- (void )searchDisplayControllerWillEndSearch : (UISearchDisplayController *)controller {
296306 [_mySearchDisplayController setActive: NO animated: YES ];
297307 [_mySearchDisplayController.searchBar setShowsCancelButton: YES animated: YES ];
298-
299- // self.mySearchDisplayController.searchResultsTableView.hidden = YES;
300- // self.navigationController.navigationBar.translucent = NO;
301308}
302309
303-
304-
305310- (void )searchBar : (UISearchBar *)searchBar textDidChange : (NSString *)searchText {
306311 NSString *strippedStr = [searchBar.text stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet ]];
307- // [self.createdTopiclist addObject:strippedStr];
308312 _createdTopicName = strippedStr;
309313 [self .mySearchDisplayController.searchResultsTableView reloadData ];
310314}
@@ -323,7 +327,6 @@ - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{
323327 NSString *strippedStr = [searchBar.text stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet ]];
324328 _createdTopicName = strippedStr;
325329 [self didSelectByTopicName: _createdTopicName];
326-
327330}
328331
329332@end
0 commit comments