English 中文(简体)
可上诉的诉讼
原标题:UITableView action row

妇地会11次视频会议 125 - UITableCiew Change, Tips, 24:30+Luke Hiesterman先生的三叉车正在给电解,在选定电池时,会增加一个细胞。

“Screenshot

我要在我提出的海洋观测系统申请中增加这一功能,但我可以说明如何做到这一点。

某些法典没有在神学中显示。 也没有可下载的烟雾来源。

谁能帮助我?

EDIT:

我可以在选定的行文下面增加一行,但这是一个其他习俗单位。

(我有一份可以接受的合同清单)

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return ((indexPath.row >= [_contracts count]) ? 40 : 60);
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [_contracts count] + ((_addedRow) ? 1 : 0);
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *reuseID = @"contract_cell";

    ContractTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseID];

    if(!cell)
    {
        // Load the top-level objects from the custom cell XIB.
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ContractTableViewCell" owner:self options:nil];
        // Grab a pointer to the first object (presumably the custom cell, as that s all the XIB should contain).
        cell = [topLevelObjects objectAtIndex:0];
        [cell setBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"contract_cell.png"]]];
    }

    NSLog(@"row?: %d", indexPath.row);
    //I thought this would work... not.
    if((indexPath.row >= [_contracts count]))
    {
        [cell.label setText:@"new"];
    }
    else
    {
        Contract *contract = [_contracts objectAtIndex:indexPath.row];

        [cell.label setText:@"test"];
    }

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(!_addedRow)
    {
        _addedRow = YES;

        [tableView deselectRowAtIndexPath:indexPath animated:NO];

        [_tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section]] withRowAnimation:UITableViewRowAnimationAutomatic];
    }
}

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    return [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section];
}

例如,我是第一行。 排在第一行以下。 但是,现在,“ForRowAtIndexPath”呼吁第2行(必须成为新的习俗)。

我如何检查这是否是一个新问题?

最佳回答

你们需要记住,选择哪几行以正确的指数显示新增增长。 目前,你一直认为,增加的行文是最后的,因为你在“表格”中重新配置了该行:只有该指数比你的合同数目大,才重新组合。

你们有5份合同,第3份合同是选定的。 if(indexPath.row >=[_Treatysig])只适用于最后一行,但实际希望这一条件适用于第四行,因此应当成为(需要在某些情形下储存选定的浏览指数)。

问题回答

这一答案应有助于你走出来。 它告诉你,如何把你的可贵的书记员置于“最新模式”之中,然后请你插入新的行文(即使是用动画):。 UIText Field in UITableViewCell - Add new cell





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签