获取tableviewcell上控件的位置
2017-03-02 本文已影响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];
}