I have a custom Cell for my TableView, with an ImageView on it.
Why is the ImageView only visible when the cell is highlighted?
The cells are created thusly:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
Site *site = [self.dataController objectInListAtIndex:indexPath.row];
[[cell textLabel] setText:site.description];
return cell;
}
Check out: Custom UITableViewCell (IB) only shows in selected state
The quick synopsis of it "Filling the standard UITableViewCell.textLabel.text seems to overwrite the PrototypeCells". So it would appear you have to create and add a different text label.
也许您的UIImageView
是突出显示的背景视图的子视图,仅在选择单元格时可见?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.