How to add an image to the right of rows in TableView on iPhone?

I want to add an arrow to the right of each row in the TableView on the iPhone. Any ideas how to do this?

+3
source share
2 answers

I just worked:

-(UITableViewCellAccessoryType)tableView:(UITableView *)tableView 
        accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellAccessoryDetailDisclosureButton;
}

-(void)tableView:(UITableView *)tableView 
accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
    //add action here
}

A blue arrow will be displayed to the right of each line.

+1
source

Do you mean the default arrow (chevron) that many applications have?

UITableViewCell *myCell = ...; //GET a cell from somewhere.
myCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+4
source

Source: https://habr.com/ru/post/1703873/


All Articles