Adding the little arrow to the right side of a cell in an iPhone TableView Cell

后端 未结 9 1318
梦如初夏
梦如初夏 2021-01-29 23:21

This should be simple enough.

I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell?

相关标签:
9条回答
  • 2021-01-29 23:51

    for simple arrow:

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
    

    and for detailed arrow:

    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
    
    0 讨论(0)
  • 2021-01-29 23:59

    You can do this in Interface Builder. Simply click click on the Table View, go to Prototype Cells on the right side and make it 1. Then click that Prototype Cell and on the right look for Accessory. In the drop-down, click Disclosure Indicator.

    Interface Builder example

    0 讨论(0)
  • 2021-01-30 00:03

    IN SWIFT 5

    Use

    cell.accessoryType = .detailButton
    

    for a small Info-button on the right.

    cell.accessoryType = .disclosureIndicator
    

    for a small Info-arrow on the right.

    cell.accessoryType = .detailDisclosureButton
    

    for a small Info-button and Info-arrow on the right.

    infront of your return cell

    0 讨论(0)
提交回复
热议问题