Note that there are some explanatory texts on larger screens.

plurals
  1. POUIViewContentModeScale mode of the cell image change silently after the cell is touched(highlighted)
    primarykey
    data
    text
    <p>EDIT:</p> <p>I get the issue fixed by create a customize cell.(However, still have another <a href="https://stackoverflow.com/questions/11788197/dequeuereusablecellwithidentifier-always-return-non-nil">questions</a>.) But why the default cell does not work is still a mystery...</p> <p>Cory 's answer did not fix the issue but <code>clipsToBounds</code> is really a point and I appreciated his continuous help. So I give him the bounty but not accept his answer as the answer. The answer still in the wind....</p> <p>================================</p> <p>I set the <code>UIViewContentModeScale</code> mode of the cell image to <code>AspectFill</code> (left image) and the image was correctly displayed(Fill the image view but keep the aspect). However, after touch and hold on the cell, image's will change: the imageView's frame and contentViewMode are changed. (see the first cell of the left image below )</p> <p>This is really wired and I can believe such as basic thing could goes wrong so there must be some stuff I was missing out. </p> <p>Environment: Xcode 4.3 iOS5.1 simulator &amp; device. <img src="https://i.stack.imgur.com/tfnmV.png" alt="enter image description here"></p> <p>UPdate:</p> <p>I set the UIViewContentMode using the inspector of the storyboard.</p> <p>And by the way ,I used SDWebImage/UIImageView+WebCache.h.</p> <p>UPdate2:</p> <p>I set explicitly the content mode in the code but issue still there. [cell.imageView setContentMode:UIViewContentModeScaleAspectFill];</p> <p>update4:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AlbumCell"]; if(cell == nil){ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"AlbumCell"]; } //[cell.imageView setContentMode:UIViewContentModeScaleAspectFill]; //[cell.imageView setClipsToBounds:YES]; [self configureCell:cell atIndexPath:indexPath]; return cell; } - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { Album *album = [self.fetchedResultsController objectAtIndexPath:indexPath]; cell.textLabel.text = [album.title description]; cell.detailTextLabel.text = [self.userVisiableDateFormatter stringFromDate:album.releaseDate]; //[cell.imageView setContentMode:UIViewContentModeScaleAspectFill]; [cell.imageView setImageWithURL:[NSURL URLWithString:album.coverThumbnailUrl] placeholderImage:[self placeHolderImage]]; } </code></pre> <p><img src="https://i.stack.imgur.com/dALds.png" alt="enter image description here"></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.
 

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