Skip to content

Commit fb4156b

Browse files
author
panshiyu
committed
red point
1 parent 52a57bb commit fb4156b

File tree

6 files changed

+34
-28
lines changed

6 files changed

+34
-28
lines changed

.DS_Store

6 KB
Binary file not shown.

Coding_iOS/.DS_Store

8 KB
Binary file not shown.

Coding_iOS/Controllers/.DS_Store

6 KB
Binary file not shown.

Coding_iOS/Controllers/RootControllers/Tweet_RootViewController.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ - (void)viewDidLoad
100100
// }];
101101

102102
BOOL isBadgeValid = ![CSSearchModel hasSearchBadgeShown];
103+
isBadgeValid = YES;
103104
UIBarButtonItem *leftBarItem =[UIBarButtonItem itemWithIcon:@"search_Nav" showBadge:isBadgeValid target:self action:@selector(searchItemClicked:)];
104105
[self.parentViewController.navigationItem setLeftBarButtonItem:leftBarItem animated:NO];
105106

@@ -273,7 +274,6 @@ - (void)searchItemClicked:(id)sender{
273274
}
274275

275276
if (!_searchDisplayVC) {
276-
277277
_searchDisplayVC = ({
278278

279279
CSSearchDisplayVC *searchVC = [[CSSearchDisplayVC alloc] initWithSearchBar:_searchBar contentsController:self.parentViewController];
@@ -290,9 +290,6 @@ - (void)searchItemClicked:(id)sender{
290290
[self hideToolBar:YES];
291291
[_searchBar becomeFirstResponder];
292292

293-
// CSSearchVC *searchVC = [[CSSearchVC alloc] init];
294-
// [self.navigationController pushViewController:searchVC animated:YES];
295-
//
296293
// BOOL isBadgeValid = ![CSSearchModel hasSearchBadgeShown];
297294
// if (isBadgeValid) {
298295
// //存一下

Coding_iOS/Controllers/Topic/CSTopicCreateVC.m

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Coding_iOS/Util/OC_Category/UIBarButtonItem+Common.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ + (UIBarButtonItem *)itemWithIcon:(NSString*)iconName showBadge:(BOOL)showbadge
2121
[button setImage:[UIImage imageNamed:iconName] forState:UIControlStateNormal];
2222
[button setImage:[UIImage imageNamed:iconName] forState:UIControlStateHighlighted];
2323
CGSize imgSize = button.imageView.image.size;
24-
button.size = CGSizeMake(imgSize.width, imgSize.height + 20);
25-
CGFloat pointX = button.frame.size.width - 25;
26-
[button addBadgeTip:@"" withCenterPosition:CGPointMake(pointX, 25)];
24+
button.size = CGSizeMake(imgSize.width + 20, imgSize.height + 20);
25+
26+
27+
if (showbadge) {
28+
[button addRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(2, 2)];
29+
// CGFloat pointX = button.frame.size.width - 15;
30+
// [button addBadgeTip:@"1" withCenterPosition:CGPointMake(pointX, 5)];
31+
}
32+
2733
[button addTarget:obj action:selector forControlEvents:UIControlEventTouchUpInside];
2834
return [[UIBarButtonItem alloc] initWithCustomView:button];;
2935
}

0 commit comments

Comments
 (0)