Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom accessoryView inside UITableViewCell not visible
    text
    copied!<p>I placed a <code>UIImageView</code> in for the <code>accessoryView</code> in a <code>UITableViewCell</code> ala:</p> <pre><code>UIImage* dragHandleImage = [UIImage imageNamed:@"rtf_icon"]; UIImageView* dragHandleView = [[[UIImageView alloc] initWithImage:dragHandleImage] autorelease]; dragHandleView.tag = DRAG_HANDLE_TAG; cell.accessoryView = dragHandleView; </code></pre> <p>However, when the cell is displayed in the table, the accessoryView image is only visible on the first row in each section. After poking around, I found that somewhere between the tableview's <code>willDisplayCell:</code> delegate call and the display of the cell, the accessoryView's alpha property is set to zero. Is there anyway to prevent this so the image is visible?</p> <p>Edit: It appears to be done during the <code>layoutSubviews</code> call for the <code>UITableViewCell</code>.</p> <p>Edit: The full <code>cellForRowAtIndexPath:</code> function is long and full of cases that won't be hit in this particular instance. The code that populates the cell is below:</p> <pre><code>cell.textLabel.hidden = NO; cell.textField.hidden = YES; cell.textLabel.tag = indexPath.section * indexPath.row; NSString *filename = document.document.filename; if([filename isEqualToString:@""]) { filename = [document.document previewItemTitle]; } cell.textLabel.text = filename; cell.showsReorderControl = NO; </code></pre> <p>The following code populates the cell when the image is visible:</p> <pre><code>cell.textField.tag = indexPath.section; cell.textField.hidden = NO; cell.textField.text = [section numberedTitle]; cell.textField.enabled = canAddSections; cell.textField.clearButtonMode = UITextFieldViewModeWhileEditing; cell.textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; cell.textLabel.hidden = YES; cell.showsReorderControl = NO; </code></pre>
 

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