Подтвердить что ты не робот

Развернуть сбой UITableViewCell

Возможный дубликат:
UITableView Cell расширяется по клику

Мне нужна помощь в UITableViewCell из UITableView. Мое требование ниже:

enter image description here

посмотреть на Retweets, список и многое другое когда я нажимаю retweet, следующий появляется enter image description here

вы можете видеть, что retweet расширяет и показывает другие листинга и список и более слайд ниже. Я хочу сделать то же самое. Любые виды помощи получают высокую оценку, ссылку на учебник или что-то еще. спасибо

4b9b3361

Ответ 1

Вы также можете найти этот пример кода от Apple, полезный.

Ответ 2

Я реализовал аналогичный, используя заголовок таблицы.

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 32)];
    UIButton *sectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
    sectionButton.tag = section;
    sectionButton.frame = customView.frame;
    [sectionButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];

    UILabel *titleLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 32)] autorelease];
    titleLabel.textAlignment = UITextAlignmentCenter;
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.font = [UIFont boldSystemFontOfSize:13];
    titleLabel.textColor = [UIColor whiteColor];

    NSString *tableHeader = @"table_header_down.png";
    switch (section) {
        case 0:
            titleLabel.text = @"Section1";
            tableHeader = showSection1 ? @"table_header_up.png" : @"table_header_down.png";
            break;
        case 1:
            titleLabel.text = @"Section2";
            tableHeader = showSection2 ? @"table_header_up.png" : @"table_header_down.png";
            break;
        case 2:
            titleLabel.text = @"Section3";
            tableHeader = showSection3 ? @"table_header_up.png" : @"table_header_down.png";
            break;
        case 3:
            titleLabel.text = @"Section4";
            tableHeader = showSection4 ? @"table_header_up.png" : @"table_header_down.png";
            break;
        default:
            break;
    }
    [sectionButton setImage:[UIImage imageNamed:tableHeader] forState:UIControlStateNormal];
    [customView addSubview:sectionButton];

    [customView addSubview:titleLabel];

    return [customView autorelease];
}

Затем я загрузил ячейку соответственно логическим значениям, соответствующим каждому разделу, количество строк возвращает 0, если Bool 0, и возвращает счет, когда Bool 1.

Ответ 3

Если вы являетесь разработчиком Apple, перейдите в видеоролики WWDC и просмотрите расширенный видеоролик TableView. Он описывает, как делать именно то, о чем вы просите.

Ответ 4

Я думал, что эта applelink помогает вам в этом отличном примере просмотра таблицы