Skip to content

cell中加入webview后,如果html内容很长,push到下一页面再pop回来时,高度出现问题 #6

Description

@pengrun

解决方法:
在controller中加入以下

  • (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    // 判断webView所在的cell是否可见,如果可见就layout
    NSArray *cells = self.tableView.visibleCells;
    for (UITableViewCell *cell in cells) {
    if ([cell isKindOfClass:[BACell class]]) {
    BACell *webCell = (BACell *)cell;
    [webCell.webView setNeedsLayout];
    }
    }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions