美文网首页
获取tableviewcell上控件的位置

获取tableviewcell上控件的位置

作者: 哥是毛毛虫 | 来源:发表于2017-03-02 14:18 被阅读771次

今天在做项目的时候需要获取cell上一个button在屏幕的位置

#pragma mark - 弹出视图
-(void)popMarketAreasInLianMengVC:(UIButton *)sender{
    
    NSIndexPath *indexPath = [joinTable indexPathForCell:(JoinTableCell *)sender.superview.superview];
    
    CGRect rectInTableView = [joinTable rectForRowAtIndexPath:indexPath];
    
    
    CGRect rect = [joinTable convertRect:rectInTableView toView:[joinTable superview]];
    
    
    NSLog(@"sender = %f", rect.origin.y);
    
    PopAlertView *popView = [[PopAlertView alloc] initWithFrame:self.view.bounds];
    [popView creatUIWithType:3 withPoint:rect.origin.y];
    popView.isNeed = NO;
    [popView pop];
    
}


相关文章

网友评论

      本文标题:获取tableviewcell上控件的位置

      本文链接:https://www.haomeiwen.com/subject/hjnhgttx.html