iPhone правильные координаты окна альбомной ориентации

Я пытаюсь получить координаты окна табличного представления с использованием следующего кода:

[self.tableView.superview convertRect:self.tableView.frame toView:nil]

It reports the correct coordinates while in portrait mode, but when I rotate to landscape it no longer reports correct coordinates. First off, it flips the x, y coordinates and the width and height. That's not really the problem though. The real problem is that the coordinates are incorrect. In portrait the window coordinates for the table view's frame are {{0, 114}, {320, 322}}, while in landscape the window coordinates are {{32, 0}, {204, 480}}. Obviously the x-value here is incorrect, right? Shouldn't it be 84? I'm looking for a fix to this problem, and if anybody knows how to get the correct window coordinates of a view in landscape mode, I would greatly appreciate it if you would share that knowledge with me.

Here are some screenshots so you can see the view layout.

Portrait: http://i.stack.imgur.com/IaKJc.png

Landscape: http://i.stack.imgur.com/JHUV6.png

8
задан EJV 17 May 2011 в 17:16
поделиться