Как показать индикатор раскрытия, когда ячейки находятся в режиме редактирования? - PullRequest
20 голосов
/ 19 июля 2010

У меня есть UITableView, который можно редактировать.Я отображаю ячейки так:

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

    static NSString *CellIdentifier = @"Cell";

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

    // Configure the cell...
    STWatchList *mySTWatchList;
    mySTWatchList = [items objectAtIndex:indexPath.row];

    cell.textLabel.text = mySTWatchList.watchListName;

    return cell;
}

Когда пользователь редактирует, я хотел бы показать индикатор раскрытия.Как мне это сделать?

Ответы [ 2 ]

55 голосов
/ 19 июля 2010
cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
0 голосов
/ 20 сентября 2011
    if (indexPath.row==0)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
        cell.selectionStyle = UITableViewCellSelectionStyleGray;
        cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }

    else
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...