Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I edit your code that may help you.</p> <pre><code> static NSString *CellIdentifier = @"CellOrder"; static NSString *glowCellIdentifier = @"glowCellOrder"; UITableViewCell *cell = nil; if (cellIsLastOne == TRUE) { cell = [tableView dequeueReusableCellWithIdentifier:glowCellIdentifier]; } else { cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; } if (cell == nil) { if (cellIsLastOne == TRUE) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:glowCellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleGray; } else { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } cell.accessoryType = UITableViewCellAccessoryNone; } if (cellIsLastOne == TRUE) { //name cell.textLabel.text = @"Bezahlt"; cell.textLabel.textAlignment = NSTextAlignmentCenter; cell.textLabel.font =[UIFont fontWithName:@"Avenir" size:25]; cell.textLabel.textColor = [UIColor whiteColor]; //Glossy CALayer *thisLayer = cell.layer; if (thisLayer.sublayers.count == 1) { CAGradientLayer *glossLayer = [CAGradientLayer layer]; glossLayer.frame = CGRectMake(cell.bounds.origin.x + cellOffset, cell.bounds.origin.y, self.tableView.frame.size.width - cellOffset * 2, cellItemHeight); glossLayer.colors = [NSArray arrayWithObjects: (id)[UIColor colorWithWhite:1.0f alpha:0.4f].CGColor, (id)[UIColor colorWithWhite:1.0f alpha:0.2f].CGColor, (id)[UIColor colorWithWhite:0.75f alpha:0.0f].CGColor, (id)[UIColor colorWithWhite:1.0f alpha:0.2f].CGColor, nil]; glossLayer.locations = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0f], [NSNumber numberWithFloat:0.5f], [NSNumber numberWithFloat:0.5f], [NSNumber numberWithFloat:1.0f], nil]; [thisLayer addSublayer:glossLayer]; } } else { ItemID; cell.textLabel.text = @"Name"; cell.detailTextLabel.text = @"Price"; cell.detailTextLabel.textColor = [UIColor whiteColor]; cell.textLabel.font =[UIFont fontWithName:@"Avenir" size:20]; cell.detailTextLabel.font =[UIFont fontWithName:@"Avenir" size:20]; cell.textLabel.textColor = [UIColor whiteColor]; } cell.detailTextLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.4]; cell.textLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.4]; cell.detailTextLabel.shadowOffset = CGSizeMake(0, 2); cell.textLabel.shadowOffset = CGSizeMake(0, 2); cell.backgroundColor = [UIColor colorWithRed:0.72 green:0.76 blue:0.03 alpha:1.0]; cell.textLabel.backgroundColor = [UIColor clearColor]; cell.detailTextLabel.backgroundColor = [UIColor clearColor]; return cell; </code></pre> <p>This code is efficient to reuse cell and save memory.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload