I've been facing problem to add custom cell in JKExpandableTableView ,How Can I add Custom Cell as a child,Any Help will be appreciated ,Thanks.
Sorry for my english. I'd like to achieve output like

Note: I'm using this Library JKExpandableTableView everything is working fine.
Please go to the following link. The creator himself answered the question https://github.com/jackkwok/JKExpandTableView/issues/5
jackkwok commented on 9 Aug 2014 Hi Bruno, Thanks! You may need to subclass both of them. What kind of customizations do you want to do?
JKExpandTableView
is a subclass of UITableView
.
You must implement delegate of UITableView
.
ex)
Example class
@interface CustomCell : UITableViewCell
@end`
@implementation CustomCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self.contentView setBackgroundColor:[UIColor redColor]];
}
return self;
}
@end
You implement delegate for CustomCell.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifierCell = @"CustomCell";
CustomCell *cell = (CustomCell *)[tableview dequeueReusableCellWithIdentifier:identifierCell];
if(cell == nil) {
cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:invitationCell];
}
return cell;
}
来源:https://stackoverflow.com/questions/26071132/add-custom-cell-to-jkexpandtableview-as-child-cell-in-ios