cell上的控件距离window的间距
LHBMainTableViewCell*cell=[_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:button.tag-50]];
UIWindow* window = [UIApplication sharedApplication].keyWindow;
CGRect rect1 = [button convertRect:button.frame fromView:cell];//获取button在contentView的位置
CGRect _rect2 = [button convertRect:rect1 toView:window];
获取window上面的控件的距离
CGRect _rect2 = [button convertRect:button.bounds toView:window];//获取button在contentView的位置
网友评论