相关疑难解决方法(0)

选择后,您可以在UITableViewCell上设置高度变化动画吗?

UITableView在我的iPhone应用程序中使用了一个,我有一个属于一个组的人员列表.我希望这样当用户点击特定的人(从而选择单元格)时,单元格的高度会增加,以显示多个UI控件来编辑该人的属性.

这可能吗?

cocoa-touch uitableview ios

390
推荐指数
9
解决办法
12万
查看次数

ios - 像Twitter应用程序一样扩展表格视图单元格

我想在选择推文时与Twitter应用程序具有相同的行为:扩展行并添加补充内容.

所以这不仅是一个基本的行调整大小.我想我需要2个不同的自定义单元格,所以我做了类似的事情:

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([indexPath compare:self.selectedIndexPath] != NSOrderedSame) {
        FirstCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FirstCell"];
        if (!cell) {
            cell = [[FirstCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"FirstCell"];
        }

        cell.firstnameLabel.text = [[self.items objectAtIndex:indexPath.row] objectForKey:@"firstname"];

        return cell;
    }
    else {
        SecondCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SecondCell"];
        if (!cell) {
            cell = [[SecondCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SecondCell"];
        }

        cell.firstnameLabel.text = [[self.items objectAtIndex:indexPath.row] objectForKey:@"firstname"];
        cell.lastnameLabel.text = [[self.items objectAtIndex:indexPath.row] objectForKey:@"lastname"];

        return cell;
    }

}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if ([indexPath compare:self.selectedIndexPath] == NSOrderedSame) …
Run Code Online (Sandbox Code Playgroud)

twitter animation uitableview ios

4
推荐指数
1
解决办法
7632
查看次数

标签 统计

ios ×2

uitableview ×2

animation ×1

cocoa-touch ×1

twitter ×1