iPhone - Get Position of UIView within entire UIWindow

后端 未结 6 1402
长发绾君心
长发绾君心 2020-11-27 09:14

The position of a UIView can obviously be determined by view.center or view.frame etc. but this only returns the position of the

6条回答
  •  Happy的楠姐
    2020-11-27 09:51

    In Swift:

    let globalPoint = aView.superview?.convertPoint(aView.frame.origin, toView: nil)
    

提交回复
热议问题