@@ -49,7 +49,6 @@ @interface CSSearchDisplayVC () <UISearchBarDelegate, UITableViewDelegate, UITab
49
49
- (void )initSubViewsInContentView ;
50
50
- (void )initSearchResultsTableView ;
51
51
- (void )initSearchHistoryView ;
52
- - (void )didClickedMoreHotkey : (UIGestureRecognizer *)sender ;
53
52
- (void )didCLickedCleanSearchHistory : (id )sender ;
54
53
- (void )didClickedContentView : (UIGestureRecognizer *)sender ;
55
54
- (void )didClickedHistory : (UIGestureRecognizer *)sender ;
@@ -125,9 +124,9 @@ - (void)setActive:(BOOL)visible animated:(BOOL)animated {
125
124
// [self.searchBar.superview addSubview:_backgroundView];
126
125
// [self.searchBar.superview addSubview:_contentView];
127
126
// [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];
131
130
__weak typeof (self) weakSelf = self;
132
131
self.searchBar .delegate = weakSelf;
133
132
}
@@ -137,26 +136,9 @@ - (void)setActive:(BOOL)visible animated:(BOOL)animated {
137
136
#pragma mark Private Method
138
137
139
138
- (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
-
157
139
__weak typeof (self) weakSelf = self;
158
140
159
- _topicHotkeyView = [[TopicHotkeyView alloc ] initWithFrame: CGRectMake (0 , 44 , kScreen_Width , 0 )];
141
+ _topicHotkeyView = [[TopicHotkeyView alloc ] initWithFrame: CGRectMake (0 , 0 , kScreen_Width , 0 )];
160
142
_topicHotkeyView.block = ^(NSDictionary *dict){
161
143
[weakSelf.searchBar resignFirstResponder ];
162
144
@@ -168,7 +150,7 @@ - (void)initSubViewsInContentView {
168
150
[_contentView addSubview: _topicHotkeyView];
169
151
[_topicHotkeyView mas_makeConstraints: ^(MASConstraintMaker *make) {
170
152
make.left .mas_equalTo (@0 );
171
- make.top .mas_equalTo (@44 );
153
+ make.top .mas_equalTo (@0 );
172
154
make.width .mas_equalTo (kScreen_Width );
173
155
make.height .mas_equalTo (@0 );
174
156
}];
@@ -188,9 +170,6 @@ - (void)initSubViewsInContentView {
188
170
189
171
[weakSelf.topicHotkeyView setHotkeys: hotkeyArray];
190
172
[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 );
194
173
make.height .mas_equalTo (weakSelf.topicHotkeyView .frame .size .height );
195
174
}];
196
175
}
@@ -220,7 +199,7 @@ - (void)initSearchResultsTableView {
220
199
}];
221
200
}
222
201
223
- [self .parentVC.parentViewController. view addSubview: tableView];
202
+ [self .parentVC.view addSubview: tableView];
224
203
225
204
self.headerLabel = ({
226
205
UILabel *label = [[UILabel alloc ] initWithFrame: CGRectMake (0 , 2 , kScreen_Width , 44 )];
@@ -244,10 +223,6 @@ - (void)initSearchResultsTableView {
244
223
});
245
224
}
246
225
[_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];
251
226
252
227
[_searchTableView reloadData ];
253
228
[self refresh ];
@@ -331,14 +306,6 @@ - (void)initSearchHistoryView {
331
306
332
307
}
333
308
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
-
342
309
- (void )didCLickedCleanSearchHistory : (id )sender {
343
310
344
311
[CSSearchModel cleanAllSearchHistory ];
@@ -419,11 +386,11 @@ - (void)analyseLinkStr:(NSString *)linkStr{
419
386
}
420
387
UIViewController *vc = [BaseViewController analyseVCFromLinkStr: linkStr];
421
388
if (vc) {
422
- [self .parentVC.parentViewController. navigationController pushViewController: vc animated: YES ];
389
+ [self .parentVC.navigationController pushViewController: vc animated: YES ];
423
390
}else {
424
391
// 网页
425
392
WebViewController *webVc = [WebViewController webVCWithUrlStr: linkStr];
426
- [self .parentVC.parentViewController. navigationController pushViewController: webVc animated: YES ];
393
+ [self .parentVC.navigationController pushViewController: webVc animated: YES ];
427
394
}
428
395
}
429
396
@@ -462,7 +429,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
462
429
cell.userBtnClickedBlock = ^(User *curUser){
463
430
UserInfoViewController *vc = [[UserInfoViewController alloc ] init ];
464
431
vc.curUser = curUser;
465
- [self .parentVC.parentViewController. navigationController pushViewController: vc animated: YES ];
432
+ [self .parentVC.navigationController pushViewController: vc animated: YES ];
466
433
};
467
434
cell.mediaItemClickedBlock = ^(HtmlMediaItem *curItem){
468
435
[weakSelf analyseLinkStr: curItem.href];
@@ -485,7 +452,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
485
452
vc.curTweet = tweet;
486
453
vc.deleteTweetBlock = ^(Tweet *toDeleteTweet){
487
454
};
488
- [self .parentVC.parentViewController. navigationController pushViewController: vc animated: YES ];
455
+ [self .parentVC.navigationController pushViewController: vc animated: YES ];
489
456
490
457
}
491
458
0 commit comments