gpt4 book ai didi

ios - 我们可以将 UITableView 添加到 Custom UITableViewcell 中吗?

转载 作者:行者123 更新时间:2023-11-29 02:10:13 25 4
gpt4 key购买 nike

我想添加一个UITableView,上面有两种自定义UITableViewCell。其中一个 Cell 应该包含 UITableView 和其他自定义 Cells H。这就是我的 UITableViewCell 代码的样子,我在上面添加了另一个 UITableView .

#import "MainDetailsCell.h"
#import "SubCell.h"

static NSString * const SubCellIdentifier = @"SubCell";

@implementation MainDetailsCell


- (void)awakeFromNib {
// Initialization code
[_DetailsTable registerNib:[UINib nibWithNibName:SubCellIdentifier bundle:[NSBundle mainBundle]] forCellReuseIdentifier:SubCellIdentifier];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

#pragma mark -tableview Methods

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 4;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

return UITableViewAutomaticDimension;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *retCell;

SubCell *cell = [_DetailsTable dequeueReusableCellWithIdentifier:LocationDetailsCellIdentifier forIndexPath:indexPath];

retCell=cell;

[retCell setSelectionStyle:UITableViewCellSelectionStyleNone];

return retCell;
}



@end

最佳答案

是的,你可以在 UITableViewCell 上添加一个 UITableView -

有关相同内容的更多信息,请参阅以下链接-

Is it possible to add UITableView within a UITableViewCell

关于ios - 我们可以将 UITableView 添加到 Custom UITableViewcell 中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29361107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com