I am getting a black patch partially on screen. Its a UIView and this happens only when device is in landscape mode. In portrait, it works fine.
Actual screenshot on iPad 2:
(Check the black patch)
Here is my View Hierarchy in Xcode:
(Please check the UIView highlighted. It is the one which is not completely stretched to the device's width)
Being newbie in iOS development, I am not sure about where is it going wrong. Would this be because of wrong dimensions of self.view ?
This is how I am defining self.view
CGRect deviceDimensions = [[UIScreen mainScreen] applicationFrame];
self.view = [[UIView alloc] initWithFrame:deviceDimensions];
I tried explicitly setting width (just for debugging) as follows:
CGRect deviceDimensions = [[UIScreen mainScreen] applicationFrame];
deviceDimensions.size.width = 768;
self.view = [[UIView alloc] initWithFrame:deviceDimensions];
but still its showing same.
Device: iPad 2 - Screen size: 1024x768 iOS 8.2 Xcode v6.2
Thanks.