Changeset 3889


Ignore:
Timestamp:
01/17/13 21:39:07 (2 years ago)
Author:
beaucollins
Message:

Fixed tableview cells from showing recycled content when scrolling.

Still waiting on API updates to complete this view.

Location:
trunk/Classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Classes/NotificationsFollowDetailViewController.m

    r3886 r3889  
    110110    NotificationsFollowTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    111111    if (cell == nil) { 
    112         cell = [[NotificationsFollowTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
     112        cell = [[NotificationsFollowTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; 
    113113        [cell.actionButton addTarget:self action:@selector(followBlog:) forControlEvents:UIControlEventTouchUpInside]; 
    114114    } 
     115     
     116    cell.textLabel.text = @""; 
     117    cell.detailTextLabel.text = @""; 
     118    [cell.actionButton setHidden:NO]; 
     119    cell.accessoryType = UITableViewCellAccessoryNone; 
    115120     
    116121    NSDictionary *selectedNote = [_noteData objectAtIndex:indexPath.row]; 
     
    137142            } 
    138143            [cell.actionButton setTag:indexPath.row]; 
    139             if ([noteActionDetails objectForKey:@"blog_url"]) 
    140                 cell.textLabel.text = [[NSString decodeXMLCharactersIn:[noteActionDetails objectForKey:@"blog_url"]] stringByReplacingOccurrencesOfString:@"http://" withString:@""]; 
     144            if ([noteActionDetails objectForKey:@"blog_url"]) { 
     145                cell.detailTextLabel.text = [[NSString decodeXMLCharactersIn:[noteActionDetails objectForKey:@"blog_url"]] stringByReplacingOccurrencesOfString:@"http://" withString:@""]; 
     146                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
     147            } 
    141148        } else { 
    142149            [cell.actionButton setHidden:YES]; 
    143150        } 
     151    } else { 
     152        // No action available for this user 
     153        [cell.actionButton setHidden:YES]; 
     154        cell.textLabel.text = [selectedNote objectForKey:@"header"]; 
    144155    } 
    145156    if ([selectedNote objectForKey:@"icon"]) { 
  • trunk/Classes/NotificationsFollowTableViewCell.m

    r3856 r3889  
    2424        [self addSubview:actionButton]; 
    2525         
    26         [self.textLabel setFont:[UIFont systemFontOfSize:14.0f]]; 
    27         [self.textLabel setTextColor:[UIColor UIColorFromHex:0x0074A2]]; 
     26        [self.textLabel setTextColor:[UIColor UIColorFromHex:0x030303]]; 
    2827        [self.textLabel setBackgroundColor:[UIColor clearColor]]; 
    29         [self.textLabel setNumberOfLines:1]; 
    30         [self.textLabel setAdjustsFontSizeToFitWidth:NO]; 
    31         [self.textLabel setLineBreakMode:UILineBreakModeTailTruncation]; 
     28        [self.textLabel setFont:[UIFont boldSystemFontOfSize:16.0f]]; 
     29         
     30        [self.detailTextLabel setFont:[UIFont systemFontOfSize:14.0f]]; 
     31        [self.detailTextLabel setTextColor:[UIColor UIColorFromHex:0x0074A2]]; 
     32        [self.detailTextLabel setBackgroundColor:[UIColor clearColor]]; 
     33        [self.detailTextLabel setNumberOfLines:1]; 
     34        [self.detailTextLabel setAdjustsFontSizeToFitWidth:NO]; 
     35        [self.detailTextLabel setLineBreakMode:UILineBreakModeTailTruncation]; 
    3236         
    3337        UIImageView *imageView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"cell_gradient_bg"] stretchableImageWithLeftCapWidth:0 topCapHeight:1]]; 
    3438        [self setBackgroundView:imageView]; 
    35         self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
    3639    } 
    3740    return self; 
     
    6063    [super layoutSubviews]; 
    6164    [self.imageView setFrame:CGRectMake(10.0f, 10.0f, 80.0f, 80.0f)]; 
    62     [self.textLabel setFrame:CGRectMake(100.0f, 55.0f, self.frame.size.width - 140.0f, 30.0f)]; 
     65    [self.textLabel setFrame:CGRectMake(100.0f, 20.0f, 180.0f, 30.0f)]; 
     66    [self.detailTextLabel setFrame:CGRectMake(100.0f, 55.0f, self.frame.size.width - 140.0f, 30.0f)]; 
    6367} 
    6468 
Note: See TracChangeset for help on using the changeset viewer.