@@ -90,9 +90,10 @@ - (UIView *)myContentView{
9090- (UITableView *)myTableView {
9191 if (!_myTableView) {
9292 _myTableView = ({
93- UITableView *tableView = [[UITableView alloc ] initWithFrame: CGRectZero style: UITableViewStyleGrouped];
93+ UITableView *tableView = [[UITableView alloc ] initWithFrame: CGRectZero style: UITableViewStylePlain];
94+ tableView.backgroundColor = [UIColor whiteColor ];
9495 [tableView registerClass: [UITableViewCell class ] forCellReuseIdentifier: kCellIdentifier_BranchTag ];
95- tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine ;
96+ tableView.separatorStyle = UITableViewCellSeparatorStyleNone ;
9697 tableView.dataSource = self;
9798 tableView.delegate = self;
9899 tableView;
@@ -135,6 +136,11 @@ - (void)loadUIElement{
135136 [self .myContentView addSubview: self .mySegmentedControl];
136137
137138 self.mySegmentedControl .frame = CGRectMake (12 , (kCodeBranchTagButton_NavHeight - 30 )/2 , kScreen_Width - 2 *12 , 30 );
139+ {
140+ UIView *lineV = [[UIView alloc ] initWithFrame: CGRectMake (0 , kCodeBranchTagButton_NavHeight , kScreen_Width , 1.0 /[UIScreen mainScreen ].scale)];
141+ lineV.backgroundColor = kColorDDD ;
142+ [self .myContentView addSubview: lineV];
143+ }
138144 self.myContentView .frame = CGRectMake (0 , 0 , kScreen_Width , 0 );
139145 self.myTableView .frame = CGRectMake (0 , kCodeBranchTagButton_NavHeight , kScreen_Width , 0 );
140146
@@ -151,7 +157,7 @@ - (void)changeShowing{
151157 [self loadUIElement ];
152158 }
153159 CGPoint origin = [self convertPoint: CGPointMake (0 , CGRectGetHeight (self .bounds)) toView: self .showingContainerView];
154- CGFloat contentHeight = self.isShowing ? 0 : kCodeBranchTagButton_ContentHeight ;
160+ CGFloat contentHeight = self.isShowing ? 0 : CGRectGetHeight (self. showingContainerView . bounds ) - origin. y ;
155161 if (self.isShowing ) {// 隐藏
156162 self.enabled = NO ;
157163 [UIView animateWithDuration: 0.3 animations: ^{
@@ -255,26 +261,30 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
255261 return [self .dataList count ];
256262}
257263
258- - (CGFloat)tableView : (UITableView *)tableView heightForHeaderInSection : (NSInteger )section {
259- return 0.5 ;
260- }
261-
262- - (CGFloat)tableView : (UITableView *)tableView heightForFooterInSection : (NSInteger )section {
263- return 0.5 ;
264- }
265-
266264- (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
267265 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: kCellIdentifier_BranchTag forIndexPath: indexPath];
268- cell.textLabel .textColor = [UIColor blackColor ];
269266 cell.textLabel .font = [UIFont systemFontOfSize: 15 ];
270-
267+ cell.backgroundColor = [UIColor whiteColor ];
268+ cell.tintColor = kColorBrandGreen ;
269+
271270 CodeBranchOrTag *curBranchOrTag = [self .dataList objectAtIndex: indexPath.row];
272271 cell.textLabel .text = curBranchOrTag.name ;
273272
274273 if ([curBranchOrTag.name isEqualToString: self .titleStr]) {
275- cell.backgroundColor = [UIColor colorWithHexString: @" 0xf3f3f3" ];
274+ cell.textLabel .textColor = kColorBrandGreen ;
275+ cell.accessoryType = UITableViewCellAccessoryCheckmark;
276276 }else {
277- cell.backgroundColor = [UIColor whiteColor ];
277+ cell.textLabel .textColor = [UIColor blackColor ];
278+ cell.accessoryType = UITableViewCellAccessoryNone;
279+ }
280+
281+ static NSInteger lineTag = 11011 ;
282+ if (![cell.contentView viewWithTag: lineTag]) {
283+ CGFloat lineH = 1.0 /[UIScreen mainScreen ].scale ;
284+ UIView *lineV = [[UIView alloc ] initWithFrame: CGRectMake (15 , 44 - lineH, kScreen_Width , lineH)];
285+ lineV.tag = lineTag;
286+ lineV.backgroundColor = kColorDDD ;
287+ [cell.contentView addSubview: lineV];
278288 }
279289 return cell;
280290}
0 commit comments