With the advent of iOS 7, the offset height should now include the height of the top status area. Otherwise, iOS7 devices will have 20 pixels web browsing that are still hidden under the navigation bar.
In a project that should support iOS 7 and older devices, a macro similar to that found here:
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
It can be very helpful. The modified version of the zerotool utility code above can now look something like this:
if (self.navigationController != nil && self.navigationController.navigationBar.translucent) { top = self.navigationController.navigationBar.bounds.size.height; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) { top += [[UIScreen mainScreen] applicationFrame].origin.y; } }
Mark semsel
source share