oberbaum
oberbaum

Reputation: 2448

iPhone Tablview cell - corner triangle

Has anyone seen a snippet (or class/library) that will draw that corner triangle in a tableview cell (see below image).

enter image description here

Upvotes: 6

Views: 562

Answers (3)

DeyaEldeen
DeyaEldeen

Reputation: 11827

it's built in UITableViewCell... Simple ..

cell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator

enter image description here

Upvotes: 0

dimme
dimme

Reputation: 4424

You can create a new view from an image and then add it to the cell calling addSubview. Here is a example setting the corner upon launch:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

        CGRect cornerFrame = CGRectMake(x, y, width, height);
        UIImageView * corner = [[UIImageView alloc] initWithFrame:cornerFrame];
        [corner setImage:[UIImage imageNamed:@"corner.jpg"]];

        [cell.contentView addSubview:corner];
    }

    return cell;
}

Upvotes: 4

Joshua Weinberg
Joshua Weinberg

Reputation: 28688

Its probably just an image in the cell. Nothing too fancy, just your standard run of the mill custom UITableViewCell

Upvotes: 0

Related Questions