使用convertPoint获取父UIView中的相对位置
我已经看了十几个关于这个话题的SO问题,没有任何答案对我有用。 也许这会帮助我走上正确的道路。 想象一下这个设置: 我想获得相对于UIView的UIButton的center坐标。 换句话说,UIButton中心可能是215,80内的UITableViewCell,但相对于UIView他们应该更像260,165。我该如何转换? 以下是我所尝试的: [[self.view superview] convertPoint:button.center fromView:button]; // fail [button convertPoint:button.center toView:self.view]; // fail [button…