3

我想在 iPhone 上的 TableView 中每一行的右侧添加一个箭头。任何想法如何做到这一点?

4

2 回答 2

3

您的意思是许多应用程序都有的默认箭头(V 形)?

UITableViewCell *myCell = ...; //GET a cell from somewhere.
myCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
于 2009-02-26T06:28:37.670 回答
0

我刚刚解决了:

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

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

每行右侧将显示一个蓝色箭头。

于 2009-02-26T06:28:17.470 回答