diff --git a/iOS/Demo/LiteApp/ViewController.m b/iOS/Demo/LiteApp/ViewController.m index a1fa7ba..6c80dad 100755 --- a/iOS/Demo/LiteApp/ViewController.m +++ b/iOS/Demo/LiteApp/ViewController.m @@ -21,19 +21,12 @@ @implementation ViewController - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - _asset =[[QIYIAssetsImpl alloc] init]; + _asset = [[QIYIAssetsImpl alloc] init]; _delegateImpl = [[QIYIDelegateImpl alloc] init]; - QIYIMPViewNavController* vc = [QIYIMPViewNavController alloc]; - vc = [vc init:_asset delegate:_delegateImpl]; - [self presentViewController:vc animated:YES completion:^{ - }]; + QIYIMPViewNavController *viewController = [QIYIMPViewNavController alloc]; + viewController = [viewController init:_asset delegate:_delegateImpl]; + viewController.modalPresentationStyle = UIModalPresentationOverFullScreen; + [self presentViewController:viewController animated:YES completion:nil]; } - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - @end diff --git a/iOS/LiteAppSrc/Common/QIYICommon.h b/iOS/LiteAppSrc/Common/QIYICommon.h index f53d677..b38aba1 100755 --- a/iOS/LiteAppSrc/Common/QIYICommon.h +++ b/iOS/LiteAppSrc/Common/QIYICommon.h @@ -12,9 +12,13 @@ #define __SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define __SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) #define __NAVIGATION_HEIGHT 44.0f -#define __NAVIGATION_BUTTON_SIZE 32.0f -#define __NAVIGATION_OFFSET ((__IS_IPHONE_X == YES) ? 44.0f : 20.0f) -#define __NAVIGATION_BAR_HEIGHT ((__IS_IPHONE_X == YES) ? 88.0f : 64.0f) -#define __TABBAR_HEIGHT ((__IS_IPHONE_X == YES) ? 83.0f : 49.0f) +#define __NAVIGATION_BUTTON_SIZE 32.0f -#define __IS_IPHONE_X ((__SCREEN_HEIGHT == 812.0f) ? YES : NO) +// iPhoneX iPhoneX_MAX适配 +#define __XH_iPhoneX (__SCREEN_WIDTH == 375.f && __SCREEN_HEIGHT == 812.f ? YES : NO) +#define __XH_iPhoneX_MAX (__SCREEN_WIDTH == 414.f && __SCREEN_HEIGHT == 896.f ? YES : NO) +#define __XH_iPhoneX_X (__XH_iPhoneX || __XH_iPhoneX_MAX) + +#define __NAVIGATION_OFFSET ((__XH_iPhoneX_X == YES) ? 44.0f : 20.0f) +#define __NAVIGATION_BAR_HEIGHT ((__XH_iPhoneX_X == YES) ? 88.0f : 64.0f) +#define __TABBAR_HEIGHT ((__XH_iPhoneX_X == YES) ? 83.0f : 49.0f)