适配ios7界面的方法

来源:互联网 发布:js的面试题 编辑:程序博客网 时间:2024/04/29 12:08
#import <Foundation/Foundation.h>
 
#define IOS7_OR_LATER   ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )
#define DEVICE_IS_IPHONE5 ([[UIScreen mainScreen] bounds].size.height == 568)
 
@interfaceGlobal : NSObject
 
 
+(void)SetSubViewExternNone:(UIViewController *)viewController;
 
@end
 
#import "Global.h"
 
@implementationGlobal
 
 
+(void)SetSubViewExternNone:(UIViewController *)viewController
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
    if( IOS7_OR_LATER )
    {
        viewController.edgesForExtendedLayout = UIRectEdgeNone;
        viewController.extendedLayoutIncludesOpaqueBars = NO;
        viewController.modalPresentationCapturesStatusBarAppearance = NO;
        viewController.navigationController.navigationBar.translucent = NO;
    }
#endif  // #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
}
 
@end