Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iOS中将自定义单元格作为子单元格添加到JKExpandtableview_Ios_Objective C_Xcode5_Jkexpandtableview - Fatal编程技术网

在iOS中将自定义单元格作为子单元格添加到JKExpandtableview

在iOS中将自定义单元格作为子单元格添加到JKExpandtableview,ios,objective-c,xcode5,jkexpandtableview,Ios,Objective C,Xcode5,Jkexpandtableview,我一直面临在JKExpandableTableView中添加自定义单元格的问题,我小时候如何添加自定义单元格,如有任何帮助,将不胜感激,谢谢 对不起我的英语。 我想实现像这样的输出 注意:我正在使用这个库,一切正常。JKExpandTableView是UITableView的子类 您必须实现UITableView的委托 ex) 示例类 @interface CustomCell : UITableViewCell @end` @implementation CustomCell - (id)

我一直面临在JKExpandableTableView中添加自定义单元格的问题,我小时候如何添加自定义单元格,如有任何帮助,将不胜感激,谢谢

对不起我的英语。 我想实现像这样的输出


注意:我正在使用这个库,一切正常。

JKExpandTableView
UITableView
的子类

您必须实现
UITableView
的委托

ex)

示例类

@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
您可以为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;  
}

请转到以下链接。创造者自己回答了这个问题

jackkwok于2014年8月9日发表评论 你好,布鲁诺,谢谢!你可能需要 对它们都进行子类化。你想做什么样的定制


有人能帮我吗?,任何帮助都将不胜感激。如果你能发布你的代码片段和屏幕截图,那会更好。@chancy你能帮我吗?@chancy你能帮我吗?请发布你的代码并澄清到底是什么不起作用。