获取cell/section相对于tableView 的坐标

    xiaoxiao2021-03-25  124

    //1.获取cell相对于tableView 的坐标

    CGRectrectInTableView = [self.tableView rectForRowAtIndexPath:currentIndexPath];

            CGRect rect = [self.tableViewconvertRect:rectInTableView toView:[self.tableView superview]];

    //2.获取section相对于tableView 的坐标

            CGRect re = [self.tableViewrectForSection:currentIndexPath.section];

            CGRect sect = [self.tableViewconvertRect:re toView:[self.tableView superview]];

           DLog(@"11:%lf",rect.origin.y);

           DLog(@"12:%lf",sect.origin.y);

    转载请注明原文地址: https://ju.6miu.com/read-9349.html

    最新回复(0)