How can I add top layout guide in NIB file or how can I specify space from the top navigation bar and status bar so that it does not create problem between ios 6 and iOS 7?
Select your view. Select 'Add New Constraints' option in the InterfaceBuilder. From the dropdown menu of top or bottom constraint, select the 'Top Layout Guide' or 'Bottom Layout Guide'.
The topLayoutGuide property comes into play when a view controller is frontmost onscreen. It indicates the highest vertical extent for content that you don't want to appear behind a translucent or transparent UIKit bar (such as a status or navigation bar).
If you are creating a new xib or an storyboard in Xcode 9, safe area layout guide option is already enabled. You can disable this option explicitly by going into file inspector menu of Interface Builder and unchecking the option Use Safe Area Layout Guide.
You can disable safe area layout guide from storyboard for particular view controller. Select View Controller -> File Inspector (first tab) -> Use safe area layout guides (uncheck the checkbox).
You can do this by by implementing new property called edgesForExtendedLayout in iOS7 SDK
-(void)viewDidLoad { if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) self.edgesForExtendedLayout = UIRectEdgeNone; }
or
If you are using navigation bar and xcode5 then..
In Interface Builder,select view controller, and then navigate to the attributes inspector. In "Extend Edges". check Under Top Bars
i have solved my problem from Here
I think you need to write this condition for that
float SystemVersion=[[[UIDevice currentDevice] systemVersion] floatValue]; if(SystemVersion<7.0f) { //Currently your app is running in IOS6 or older version. So you need not to do anything. } else { // Currently your app is running in IOS7. }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With