Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With guidence from Ivan I managed to do it, not sure it is the most ecinomical method but...</p> <p>When an image added to a view I now add a Tag too. There is now a For loop which looks over the cell's Scroll View just before it is made which removes all subview which are not 0 (the default).</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { cellID = @"Cell" newsItemCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath]; if (cell == nil) { cell = [[newsItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; } // Remove the old Subviews from the cells if they are there for(UIView *subview in [cell.newsItemImages subviews]) { if (subview.tag != 0 ) { [subview removeFromSuperview]; NSLog(@"Removing View with Tag : %i", subview.tag); } } for(int imgCount = 0; imgCount &lt; [[newsExtraImages objectAtIndex:indexPath.row] count]; imgCount++) { UIImageView *smallImgView = [[UIImageView alloc]initWithFrame:CGRectMake(picXCount,0, 216, 216)]; smallImgView.tag = imgCount + 1; // I added this, plus one to keep it above 0 smallImgView.contentMode = UIViewContentModeScaleAspectFit; [smallImgView setImage:[allImages objectAtIndex:[[[newsExtraImages objectAtIndex:indexPath.row] objectAtIndex:imgCount] intValue]]]; picXCount = picXCount + 216 + 12; [cell.newsItemImages addSubview:smallImgView]; } [cell.newsItemImages setContentSize:CGSizeMake(picXCount, 216)]; return cell; } </code></pre>
    singulars
    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. VO
      singulars
      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