Skip to content

Commit

Permalink
fix DEMO reuse cell bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dequanzhu committed Jun 10, 2019
1 parent 05126c9 commit 2400a5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (void)dealloc{

- (nullable HPKView *)unReusableComponentViewWithModel:(HPKModel *)componentModel {
if (!_hotCommentView) {
_hotCommentView = [[HotCommentView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 0)];
_hotCommentView = [[HotCommentView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 0) style:UITableViewStyleGrouped];
_hotCommentView.delegate = self;
_hotCommentView.dataSource = self;
[_hotCommentView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ @implementation HotCommentView

IMP_HPKViewProtocol()

- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
self = [super initWithFrame:frame style:style];
if (self) {
self.scrollEnabled = NO;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
Expand All @@ -60,4 +60,8 @@ - (CGFloat)componentHeight{
return self.contentSize.height;
}

- (nullable UIScrollView *)componentInnerScrollView {
return self;
}

@end

0 comments on commit 2400a5f

Please sign in to comment.