ios - 调整内容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;
}
解决方案
推荐阅读
- mysql - 使用 .bat 文件更新 MySQL 数据
- android - 我们可以在 Firebase 机器人测试中编辑 maxDepth。如果是,如何?
- gradle - 使用 build.gradle 执行特定的 testng 组
- c# - BufferBlock.ReceiveAsync 在 HostedService 中挂起
- android - 我的应用程序需要多个登录角色 - 如何
- doctrine - Symfony4:如何使用 dotenv 和多个实体管理器切换实体?
- javascript - 如何在javascript echo上设置超时
- unit-testing - 如何测试创建新视图的 TornadoFX 功能?
- javascript - 如何使用cordova在我的index.js中添加我的功能“新页面”
- wpf - WPF 和 PowerShell:与 ItemTemplate 一起使用时在 ComboBox 上设置选定项