首页 > 解决方案 > 调整内容tableview自定义obj c

问题描述

从照片中可以看出,我必须解决这个问题。

在此处输入图像描述

如果我单击两条线之一,图标会弹出,label并且imageView会变小。

我必须能够在不减少内容的情况下选择和取消选择。

我正在尝试sizeToFit但没有成功...

另一件事是我以这种方式使用自定义 .xib

-(MultiIbanTableCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    NSString *idCell = @"MultiIbanTableCell";

    MultiIbanTableCell *cell;
    DtoInstrument *account = (DtoInstrument *)[self.bankSelected.dtoBank.instruments objectAtIndex:indexPath.row];
    cell = [tableView dequeueReusableCellWithIdentifier:idCell];

    if (cell) {
        [cell setBankCellWithBankData:account];
    }
    else {
        cell = [MultiIbanTableCell getBankCellWithBankData:account];

    }

    [cell.logoImage sd_setImageWithURL:[NSURL URLWithString:self.bankSelected.logo_search]
                      placeholderImage:nil
                             completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
                             }];

    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.textLabel.adjustsFontSizeToFitWidth = YES;
    cell.contentView.sizeToFit;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    //link store vuoto
    [tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
    self.selectedInstrument = (DtoInstrument *)[self.bankSelected.dtoBank.instruments objectAtIndex:indexPath.row];
    self.confirmButton.enabled = YES;
    tableView.sizeToFit;
}

标签: iosobjective-cuitableview

解决方案


推荐阅读