@@ -49,7 +49,6 @@ @interface CSSearchDisplayVC () <UISearchBarDelegate, UITableViewDelegate, UITab
4949- (void )initSubViewsInContentView ;
5050- (void )initSearchResultsTableView ;
5151- (void )initSearchHistoryView ;
52- - (void )didClickedMoreHotkey : (UIGestureRecognizer *)sender ;
5352- (void )didCLickedCleanSearchHistory : (id )sender ;
5453- (void )didClickedContentView : (UIGestureRecognizer *)sender ;
5554- (void )didClickedHistory : (UIGestureRecognizer *)sender ;
@@ -125,9 +124,9 @@ - (void)setActive:(BOOL)visible animated:(BOOL)animated {
125124// [self.searchBar.superview addSubview:_backgroundView];
126125// [self.searchBar.superview addSubview:_contentView];
127126// [self.searchBar.superview bringSubviewToFront:_contentView];
128- [self .parentVC.parentViewController. view addSubview: _backgroundView];
129- [self .parentVC.parentViewController. view addSubview: _contentView];
130- [self .parentVC.parentViewController. view bringSubviewToFront: _contentView];
127+ [self .parentVC.view addSubview: _backgroundView];
128+ [self .parentVC.view addSubview: _contentView];
129+ [self .parentVC.view bringSubviewToFront: _contentView];
131130 __weak typeof (self) weakSelf = self;
132131 self.searchBar .delegate = weakSelf;
133132 }
@@ -137,26 +136,9 @@ - (void)setActive:(BOOL)visible animated:(BOOL)animated {
137136#pragma mark Private Method
138137
139138- (void )initSubViewsInContentView {
140-
141- UILabel *lblHotKey = [[UILabel alloc ] initWithFrame: CGRectMake (12 .0f , 4 .0f , kScreen_Width , 39 .0f )];
142- [lblHotKey setUserInteractionEnabled: YES ];
143- [lblHotKey setText: @" 热门话题" ];
144- [lblHotKey setFont: [UIFont systemFontOfSize: 12 .0f ]];
145- [lblHotKey setTextColor: [UIColor colorWithHexString: @" 0x999999" ]];
146- [_contentView addSubview: lblHotKey];
147-
148- UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (didClickedMoreHotkey: )];
149- [lblHotKey addGestureRecognizer: tapGestureRecognizer];
150-
151- UIImageView *moreIconView = [[UIImageView alloc ] initWithFrame: CGRectMake (0 , 10 .0f , 20 .0f , 20 .0f )];
152- moreIconView.image = [UIImage imageNamed: @" me_info_arrow_left" ];
153- moreIconView.right = kScreen_Width - 12 ;
154- moreIconView.centerY = lblHotKey.centerY ;
155- [_contentView addSubview: moreIconView];
156-
157139 __weak typeof (self) weakSelf = self;
158140
159- _topicHotkeyView = [[TopicHotkeyView alloc ] initWithFrame: CGRectMake (0 , 44 , kScreen_Width , 0 )];
141+ _topicHotkeyView = [[TopicHotkeyView alloc ] initWithFrame: CGRectMake (0 , 0 , kScreen_Width , 0 )];
160142 _topicHotkeyView.block = ^(NSDictionary *dict){
161143 [weakSelf.searchBar resignFirstResponder ];
162144
@@ -168,7 +150,7 @@ - (void)initSubViewsInContentView {
168150 [_contentView addSubview: _topicHotkeyView];
169151 [_topicHotkeyView mas_makeConstraints: ^(MASConstraintMaker *make) {
170152 make.left .mas_equalTo (@0 );
171- make.top .mas_equalTo (@44 );
153+ make.top .mas_equalTo (@0 );
172154 make.width .mas_equalTo (kScreen_Width );
173155 make.height .mas_equalTo (@0 );
174156 }];
@@ -188,9 +170,6 @@ - (void)initSubViewsInContentView {
188170
189171 [weakSelf.topicHotkeyView setHotkeys: hotkeyArray];
190172 [weakSelf.topicHotkeyView mas_updateConstraints: ^(MASConstraintMaker *make) {
191- make.left .mas_equalTo (@0 );
192- make.top .mas_equalTo (@44 );
193- make.width .mas_equalTo (kScreen_Width );
194173 make.height .mas_equalTo (weakSelf.topicHotkeyView .frame .size .height );
195174 }];
196175 }
@@ -220,7 +199,7 @@ - (void)initSearchResultsTableView {
220199 }];
221200 }
222201
223- [self .parentVC.parentViewController. view addSubview: tableView];
202+ [self .parentVC.view addSubview: tableView];
224203
225204 self.headerLabel = ({
226205 UILabel *label = [[UILabel alloc ] initWithFrame: CGRectMake (0 , 2 , kScreen_Width , 44 )];
@@ -244,10 +223,6 @@ - (void)initSearchResultsTableView {
244223 });
245224 }
246225 [_searchTableView.superview bringSubviewToFront: _searchTableView];
247- // [self.searchBar.superview bringSubviewToFront:_searchTableView];
248-
249- // _refreshControl = [[ODRefreshControl alloc] initInScrollView:self.searchTableView];
250- // [_refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
251226
252227 [_searchTableView reloadData ];
253228 [self refresh ];
@@ -331,14 +306,6 @@ - (void)initSearchHistoryView {
331306
332307}
333308
334- - (void )didClickedMoreHotkey : (UIGestureRecognizer *)sender {
335- [self .searchBar resignFirstResponder ];
336-
337- CSHotTopicPagesVC *vc = [CSHotTopicPagesVC new ];
338- [self .parentVC.navigationController pushViewController: vc animated: YES ];
339-
340- }
341-
342309- (void )didCLickedCleanSearchHistory : (id )sender {
343310
344311 [CSSearchModel cleanAllSearchHistory ];
@@ -419,11 +386,11 @@ - (void)analyseLinkStr:(NSString *)linkStr{
419386 }
420387 UIViewController *vc = [BaseViewController analyseVCFromLinkStr: linkStr];
421388 if (vc) {
422- [self .parentVC.parentViewController. navigationController pushViewController: vc animated: YES ];
389+ [self .parentVC.navigationController pushViewController: vc animated: YES ];
423390 }else {
424391 // 网页
425392 WebViewController *webVc = [WebViewController webVCWithUrlStr: linkStr];
426- [self .parentVC.parentViewController. navigationController pushViewController: webVc animated: YES ];
393+ [self .parentVC.navigationController pushViewController: webVc animated: YES ];
427394 }
428395}
429396
@@ -462,7 +429,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
462429 cell.userBtnClickedBlock = ^(User *curUser){
463430 UserInfoViewController *vc = [[UserInfoViewController alloc ] init ];
464431 vc.curUser = curUser;
465- [self .parentVC.parentViewController. navigationController pushViewController: vc animated: YES ];
432+ [self .parentVC.navigationController pushViewController: vc animated: YES ];
466433 };
467434 cell.mediaItemClickedBlock = ^(HtmlMediaItem *curItem){
468435 [weakSelf analyseLinkStr: curItem.href];
@@ -485,7 +452,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
485452 vc.curTweet = tweet;
486453 vc.deleteTweetBlock = ^(Tweet *toDeleteTweet){
487454 };
488- [self .parentVC.parentViewController. navigationController pushViewController: vc animated: YES ];
455+ [self .parentVC.navigationController pushViewController: vc animated: YES ];
489456
490457}
491458
0 commit comments