convertPoint:toView: in landscape mode giving wrong values

前端 未结 1 697
小蘑菇
小蘑菇 2021-02-01 15:25

I have a view which is created in landscape mode (long after rotation etc.).
In this view, I want to find a point relative to the main window.
The following code works i

相关标签:
1条回答
  • 2021-02-01 15:32

    You can't use main window to calculate relative coordinates. Main window receives rotation events and passes them onto controllers which means it doesn't change the size itself (always has the same portrait bounds). That's why the solution you found makes sense: you find the coordinates relative to the view of the root controller which does receive rotation events and changes its size accordingly

    0 讨论(0)
提交回复
热议问题