Accessory disclosure indicator does not appear in custom cell

I am creating a table view with a custom cell. I used xib files to create both. My table works the way I wanted it, but there is only one problem: the cells in the View table do not display the disclosure indicator.

The indicator is displayed in the xib file after installing it from the attribute inspector, but not in the simulator.

I added it programmatically as well

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

InboxTableViewCell * cell = (InboxTableViewCell *)[tableView            dequeueReusableCellWithIdentifier:[InboxTableViewCell reuseIdentifier]];


   if (cell == nil)
   {
       [[NSBundle mainBundle] loadNibNamed:customCellName owner:self options:nil];
       cell = _tblVIewInboxCell;
       _tblVIewInboxCell = nil;
   }

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.lblTitleInbox.text = @"Title";
    cell.lblSubTitleInbox.font = [UIFont fontWithName:@"Verdana" size:16.0];
    cell.lblSubTitleInbox.text = @"SubTitle";
    cell.lblSubTitleInbox.font = [UIFont fontWithName:@"Verdana" size:12.0];

  return cell;
}

So someone please help me.

Thanks in advance.

+4
source share
4 answers

I read it in a tutorial

I found this now in the tutorial I was looking at. I found it here: http://www.codingexplorer.com/segue-uitableviewcell-taps-swift/

, , .

, !

+14

, , , , layoutSubviews, super.layoutSubviews . , .

, :

class WQPlaneCell: UITableViewCell {

    @IBOutlet private weak var thumbnailImage: UIImageView!
    @IBOutlet private weak var planeNoLabel: UILabel!
    @IBOutlet private weak var planeTypeLabel: UILabel!
    @IBOutlet private weak var ownerLabel: UILabel!

    override func layoutSubviews() {
        super.layoutSubviews() // This is important, don't forget to call the super.layoutSubviews 
        .... // do anything you want
    }
}
+6

; (, ) , .

, SUPERVIEW. / .

TableView. TableViewController , , .

+3

Try this

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) 
    {
         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
    }
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;

}
0
source

All Articles