Get your application into landscape mode and execute the following code:
UIWindow *toastWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
In iOS 7 and earlier, UIWindow
's coordinate system did not rotate. In iOS 8 it does. I am guessing the frame supplied from [[UIScreen mainScreen] bounds]
does not account for rotation, which could cause issues like what you're seeing.
Instead of getting the frame from UIScreen
, you could grab the frame from the appDelegate's current key window.
However, it does not appear you really need functionality supplied by UIWindow
. I'd like to echo others' recommendation that you use a UIView
for this purpose. UIView
is more generic than UIWindow
, and should be preferred.